Cloud
Cloud

Reputation: 21

AttributeError: 'XGBClassifier' object has no attribute '_le'

I am trying to fit my xgboost model object (0.60 version) on OOT data, but keep getting error. I am using below line of code:

fname = "xgb"  
if isinstance(xgb, XGBClassifier):
 regressor = XGBClassifier()
 r = pickle.load(open(fname, "rb" ))
 print(r)
 regressor._Booster = r._Booster
 regressor.set_params(**r.get_xgb_params())

y_predict = regressor.predict(oot)

Error:

AttributeError: 'XGBClassifier' object has no attribute '_le'

I also tried scoring the OOT data using alternate way:

scored = scored_data.predict(oot)

Then i get below error (i have created similar environment replicating model dev)

class_probs = self.booster().predict(test_dmatrix,output_margin=output_margin,ntree_limit=ntree_limit)

TypeError: 'str' object is not callable

Upvotes: 2

Views: 3324

Answers (1)

Abhinav Gupta
Abhinav Gupta

Reputation: 1958

I was getting the same issue with version 0.90. Upgrading to 1.6.1 fixed it for me.

Upvotes: 1

Related Questions