I created a GridSearchCV for a Random Forest Regressor. Now I want to check the feature importance. I searched around and I found this:
rf_gridsearch.best_estimator_.named_steps.feature_importances_
This already works, but my training data is huge, 669 attributes. Therefore, I need the attribute names. So I found this code:
rf_gridsearch.best_estimator_.named_steps["step_name"].feature_importances_
But I don't know what the "named_steps["step_name"]" are.
I tried something like this:
named_steps = X_train.columns
But this doesn't work. Could somebody explain me what named_steps["step_name"]
is?