I use python library sklearn.ensemble.RandomForestClassifier
.
I want to know the feature importance for every feature to all tree. Suppose, I have P
features and M
trees.
I want to calculate PxM
matrix where every feature's feature importance is calculated to every tree.
Here is the source code of sklearn for Random Forest feature importances. In this method, I think all_importances
variable is PxM matrix. But How can I access that variable?
Thanks in advance.