I am using SKlearn GBM predictions for one of my exercises, and for understanding feature importance after fitting on train data, I can easily do it like this in python, since 'fit' method has those
But I would like to know the feature importance on test dataset too, but 'predict' method doesn't have anything like this
from sklearn import ensemble
gbm = ensemble.GradientBoostingRegressor(**params)##
gbm.fit(X_train, y_train))
# feature importance
feat_imp = pd.DataFrame(gbm.feature_importances_)
Is there any solution, which can help me to understand the important feature on the test or predict dataset with sklearn gbm or otherwise
Thanks for all the help!