问题描述
我正在尝试将我的xgboost模型对象(0.60版本)适合OOT数据,但始终会出错。我正在使用以下代码行:
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)
错误:
AttributeError: 'XGBClassifier' object has no attribute '_le'
我还尝试使用其他方式对OOT数据评分:
scored = scored_data.predict(oot)
然后我遇到错误(我创建了类似的环境复制模型dev)
class_probs = self.booster().predict(test_dmatrix,output_margin=output_margin,ntree_limit=ntree_limit)
TypeError: 'str' object is not callable
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)