XGB predict_proba and predict method not defined self.X #1269
-
After training new XGBClassifier I tried to load and predict using
After debugging the source code I noticed they not initialized correctly the self.X attribute. VerticaPy/verticapy/machine_learning/vertica/base.py Lines 4595 to 4596 in 4d84228 self.X never define before (same for predict). the only time the methods work fine for me was after VerticaPy/verticapy/machine_learning/vertica/base.py Lines 2313 to 2319 in 4d84228 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Thanks for reporting this issue, I'll do some tests and come back to you. |
Beta Was this translation helpful? Give feedback.
-
You can not predict if you did not train a model. I just trained and load a from verticapy.machine_learning.vertica import XGBClassifier
table = "titanic"
X = ["fare", "age"]
y = "survived"
model = XGBClassifier("model_test_260924")
model.drop()
model.fit(table, X, y)
model.X Result: ['"fare"', '"age"'] Loading the model and checking attribute from verticapy.machine_learning.vertica import load_model
model2 = load_model("model_test_260924")
model2.X Result: ['fare', 'age'] Besides, it is obvious that attributes X and y are created when fitting the model. It is always advise to write entirely the table name, X and y whenever making a prediction AS the variables name might not be the same in the new table. |
Beta Was this translation helpful? Give feedback.
You can not predict if you did not train a model.
I just trained and load a
XGBClassifier
and I got no issue.Result:
Loading the model and checking attribute
X
:Result:
Besides, it is obvious that attributes X and y are created when fitting the model. It is always advise to write entirely the table name, X and y whenever making a prediction AS th…