前提・実現したいこと
1.XGBoostでFeature Importanceの出力表を動作させる。
回帰だから出力表が出せないのか、エラーの回避ができません。
有識者の方々、ご助力お願いいたします。
発生している問題・エラーメッセージ
XGBoostError: [14:02:59] src/objective/objective.cc:23: Unknown objective function ['reg:squarederror']
該当のソースコード
param_grid = {
'max_depth': [3],
'gamma':np.arange(0.03),
'booster':['gbtree'],
'objective':['reg:squarederror'],
'eta':np.arange(0.03)
}
clf_cv = model_selection.GridSearchCV(xgb.XGBRegressor(),param_grid=param_grid,scoring = 'neg_mean_squared_error')
clf_cv.fit(x_train, y_train)
y_train_pred = clf_cv.predict(x_train)
y_test_pred = clf_cv.predict(x_test)
dtrain = xgb.DMatrix(x_train,label=x_train)
bst=xgb.train(param_grid,dtrain)
xgb.plot_importance(bst)
回答1件
あなたの回答
tips
プレビュー