Anyway to know all details of trees grown using RandomForestClassifier in scikit-learn? I am building a standard RandomForest classifier (named model, see the code below) using scikit-learn package. Now, I want to get all parameters of one Randomforest classifier (including its trees (estimators)), so that I can manually draw the flow chart for each tree of the RandomForest classifier. I wonder if anyone knows how it can be done?

Thank you in advance.

Manh

#Import Library
from sklearn.ensemble import RandomForestClassifier #use RandomForestRegressor for regression problem
#Assumed you have, X (predictor) and Y (target) for training data set and x_test(predictor) of test_dataset
# Create Random Forest object
model= RandomForestClassifier(n_estimators=10, max_depth=5) #n_estimators=1000 oob_score = True
#====
#X, y = input_X, input_y

from sklearn.cross_validation import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X,y,test_size = 0.2, random_state = 4)

# Train the model using the training sets and check score
model.fit(X_train, y_train)

#Predict Output
y_pred_train = model.predict(X_train)
y_pred_test = model.predict(X_test)

#accuracy
from sklearn.metrics import accuracy_score
print(accuracy_score(y_train,y_pred_train))
print(accuracy_score(y_test,y_pred_test))
I think Terence Parr's answer is now partly outdated. You can get the same (and more) with:

print("Tree depths: ", [t.get_depth() for t in model.estimators_])
print("Tree number of leaves: ", [t.get_n_leaves() for t in model.estimators_])