我正在python3.5中使用scikit-learn lib训练我的数据。训练过程完成,我使用joblib保存训练后的模型。但是之后,我无法加载训练有素的模型。
错误消息是: AttributeError:“ XGBClassifier”对象没有属性“ n_jobs”
在调试时:'model = joblib ...'行可以运行,在此行之后,参数模型为:'无法获取'代表'
#training and save trained model:(worked)
from xgboost.sklearn import XGBClassifier
from sklearn.externals import joblib
model = XGBClassifier()
model.fit(x_train, y_train)
joblib.dump(model, "xgboost_parcel_spp.m")from xgboost.sklearn
#load trained model(wrong):
model = joblib.load(os.path.join(thu_sub_sppfea_root, "xgboost_thu_spp.m"))