04pallav
9/11/2017 - 10:30 PM

RandomForestClassifier

RandomForestClassifier

from sklearn.ensemble import BaggingClassifier, AdaBoostClassifier, RandomForestClassifier, AdaBoostClassifier

clf = RandomForestClassifier(n_estimators = 1000)
clf.fit(X,y)
#n_estimators is the nof trees in the forest

importances = clf.feature_importances_

#RandomForestClassifier(n_estimators=10, criterion='gini', max_depth=None, min_samples_split=2, min_samples_leaf=1, min_weight_fraction_leaf=0.0, max_features='auto', max_leaf_nodes=None, bootstrap=True, oob_score=False, n_jobs=1, random_state=None, verbose=0, warm_start=False, class_weight=None)