# Random forest feature importance with max_depth = 1

I am using sklearn to estimate a random forest classifier. Out of curiosity I have set max_features=None and max_depth=1. Everything else is left untouched.

I would expect the feature importance, which I get via feture_importances_ to consist of only 1 value. However, the feature_importance has values for all values of my features. How can that be possible and what am I missing?

This is because a Random Forest consist not only in one decision tree but N, being N the parameter in n_estimators (https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html, https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html)
Therefore, you will have n_estimators decision trees with max_depth=1. This allows you to have several feature importances.