Skip to content

Commit 3dfd1c4

Browse files
authored
fix: AttributeError from feature_name
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.
1 parent 08bbc36 commit 3dfd1c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

12_gradient_boosting_machines/08_making_out_of_sample_predictions.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@
619619
"\n",
620620
" test_set = data.iloc[test_idx, :]\n",
621621
" y_test = test_set.loc[:, label].to_frame('y_test')\n",
622-
" y_pred = model.predict(test_set.loc[:, model.feature_name()])\n",
622+
" y_pred = model.predict(test_set.loc[:, model.feature_names_])\n",
623623
" predictions.append(y_test.assign(prediction=y_pred))\n",
624624
"\n",
625625
" if position == 0:\n",

0 commit comments

Comments
 (0)