Skip to content

Commit

Permalink
fix: AttributeError from feature_name
Browse files Browse the repository at this point in the history
The attribute of 'model' CatBoostRegressor  should simply be 'feature_names_' rather than using as a method. Please refer to [catboost](https://catboost.ai/docs/concepts/python-reference_catboostregressor.html) API and accept this PR.
  • Loading branch information
sherrytp authored Aug 4, 2021
1 parent 08bbc36 commit 3dfd1c4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@
"\n",
" test_set = data.iloc[test_idx, :]\n",
" y_test = test_set.loc[:, label].to_frame('y_test')\n",
" y_pred = model.predict(test_set.loc[:, model.feature_name()])\n",
" y_pred = model.predict(test_set.loc[:, model.feature_names_])\n",
" predictions.append(y_test.assign(prediction=y_pred))\n",
"\n",
" if position == 0:\n",
Expand Down

0 comments on commit 3dfd1c4

Please sign in to comment.