Skip to content

XGB predict_proba and predict method not defined self.X #1269

Closed Answered by oualib
MatufA asked this question in Potential bug
Discussion options

You must be logged in to vote

You can not predict if you did not train a model.

I just trained and load a XGBClassifier and I got no issue.

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 X:

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 th…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by oualib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants