I use scikit-learn RandomForestRegressor and I set an explicit value for max_features. When I do this, I expect that for each tree in the forest there is a random subset of max_features length attributes that is considered when assembling the tree (is this correct or does it perform a subset of functions from the entire set of functions for each node of each tree?). I am trying to figure out which subset of functions was used by each tree.
Here is an example of where I am now:
rf = RandomForestRegressor(n_estimators=10, max_depth=2, max_features=10)
forest = rf.fit(X,y)
trees = forest.estimators_
If I wanted to know what functions were used in the first tree, I think I can do the following:
[j for j,v in enumerate(trees[0].feature_importances_) if v > 0]
, . () 3 , 10 . , feature_importances_ , , vs, .
, , DecisionTreeRegressor _tree.
.
UPDATE
, , , node, , splitter.features. , .