Module Expr Str Print NameLoad Import alias identifier Import alias identifier ImportFrom alias ImportFrom alias Assign TupleStore NameStore NameStore Call NameLoad keyword Num keyword Num keyword Num keyword Num keyword Num keyword Num keyword Num keyword NameLoad Assign NameStore Call NameLoad keyword Num keyword Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr keyword Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Slice Num Print Str For NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body Print BinOpMod Str TupleLoad BinOpAdd NameLoad Num SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad NameLoad Index NameLoad keyword Str keyword SubscriptLoad NameLoad Index NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Num SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call AttributeLoad NameLoad attr
N/A N/A 
=========================================
Feature importances with forests of trees
=========================================

This examples shows the use of forests of trees to evaluate the importance of
features on an artificial classification task. The red bars are the feature
importances of the forest, along with their inter-trees variability.

As expected, the plot suggests that 3 features are informative, while the
remaining are not.
 N/A __doc__ N/A numpy np N/A matplotlib.pyplot plt sklearn.datasets make_classification sklearn.ensemble ExtraTreesClassifier N/A N/A X y N/A make_classification n_samples 1000 n_features 10 n_informative 3 n_redundant 0 n_repeated 0 n_classes 2 random_state 0 shuffle False N/A forest N/A ExtraTreesClassifier n_estimators 250 random_state 0 N/A N/A N/A forest fit X y N/A importances N/A forest feature_importances_ N/A std N/A N/A np std N/A N/A tree feature_importances_ N/A tree N/A forest estimators_ axis 0 N/A indices N/A N/A N/A np argsort importances N/A -1 N/A Feature ranking: N/A f N/A range N/A N/A X shape N/A 1 N/A N/A N/A %d. feature %d (%f) N/A N/A f 1 N/A indices N/A f N/A importances N/A N/A indices N/A f N/A N/A N/A plt figure N/A N/A N/A plt title Feature importances N/A N/A N/A plt bar N/A range N/A N/A X shape N/A 1 N/A importances N/A indices color r yerr N/A std N/A indices align center N/A N/A N/A plt xticks N/A range N/A N/A X shape N/A 1 indices N/A N/A N/A plt xlim N/A -1 N/A N/A X shape N/A 1 N/A N/A N/A plt show