Module Expr Str Print NameLoad Import alias identifier Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias Assign NameStore Num Assign NameStore ListLoad Str Str Str Str Str Str Str Str Str Str Assign NameStore ListLoad Call NameLoad Num Call NameLoad keyword Str keyword Num Call NameLoad keyword Num keyword Num Call NameLoad BinOpMult Num Call NameLoad Num keyword NameLoad Call NameLoad keyword Num Call NameLoad keyword Num keyword Num keyword Num Call NameLoad keyword Num Call NameLoad Call NameLoad Call NameLoad Assign TupleStore NameStore NameStore Call NameLoad keyword Num keyword Num keyword Num keyword Num keyword Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Num AugAssignAdd NameStore BinOpMult Num Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign NameStore TupleLoad NameLoad NameLoad Assign NameStore ListLoad Call NameLoad keyword Num keyword Num Call NameLoad keyword Num keyword Num keyword Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword TupleLoad Num Num Assign NameStore Num For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign TupleStore NameStore NameStore NameLoad Assign NameStore Call AttributeLoad Call NameLoad attr NameLoad Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad keyword Num keyword Num Assign TupleStore NameStore NameStore TupleLoad BinOpSub Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Index Num attr Num BinOpAdd Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Index Num attr Num Assign TupleStore NameStore NameStore TupleLoad BinOpSub Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Index Num attr Num BinOpAdd Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Index Num attr Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad ListLoad Str Str Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad BinOpAdd Call NameLoad NameLoad Num NameLoad If CompareEq NameLoad Num body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num SubscriptLoad NameLoad ExtSlice Slice Index Num keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num SubscriptLoad NameLoad ExtSlice Slice Index Num keyword NameLoad keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr TupleLoad Expr Call AttributeLoad NameLoad attr TupleLoad AugAssignAdd NameStore Num For TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad BinOpAdd Call NameLoad NameLoad Num NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If Call NameLoad NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr orelse Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ExtSlice Slice Index Num Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num SubscriptLoad NameLoad ExtSlice Slice Index Num keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num SubscriptLoad NameLoad ExtSlice Slice Index Num keyword NameLoad keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr TupleLoad Expr Call AttributeLoad NameLoad attr TupleLoad If CompareEq NameLoad Num body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr BinOpSub Call AttributeLoad NameLoad attr Num BinOpAdd Call AttributeLoad NameLoad attr Num Call AttributeLoad BinOpMod Str NameLoad attr Str keyword Num keyword Str AugAssignAdd NameStore Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr
N/A N/A 
=====================
Classifier comparison
=====================

A comparison of a several classifiers in scikit-learn on synthetic datasets.
The point of this example is to illustrate the nature of decision boundaries
of different classifiers.
This should be taken with a grain of salt, as the intuition conveyed by
these examples does not necessarily carry over to real datasets.

Particularly in high-dimensional spaces, data can more easily be separated
linearly and the simplicity of classifiers such as naive Bayes and linear SVMs
might lead to better generalization than is achieved by other classifiers.

The plots show training points in solid colors and testing points
semi-transparent. The lower right shows the classification accuracy on the test
set.
 N/A __doc__ N/A numpy np N/A matplotlib.pyplot plt matplotlib.colors ListedColormap sklearn.model_selection train_test_split sklearn.preprocessing StandardScaler sklearn.datasets make_moons make_circles make_classification sklearn.neural_network MLPClassifier sklearn.neighbors KNeighborsClassifier sklearn.svm SVC sklearn.gaussian_process GaussianProcessClassifier sklearn.gaussian_process.kernels RBF sklearn.tree DecisionTreeClassifier sklearn.ensemble RandomForestClassifier AdaBoostClassifier sklearn.naive_bayes GaussianNB sklearn.discriminant_analysis QuadraticDiscriminantAnalysis N/A h 0.02 N/A names N/A Nearest Neighbors Linear SVM RBF SVM Gaussian Process Decision Tree Random Forest Neural Net AdaBoost Naive Bayes QDA N/A classifiers N/A N/A KNeighborsClassifier 3 N/A SVC kernel linear C 0.025 N/A SVC gamma 2 C 1 N/A GaussianProcessClassifier N/A 1.0 N/A RBF 1.0 warm_start True N/A DecisionTreeClassifier max_depth 5 N/A RandomForestClassifier max_depth 5 n_estimators 10 max_features 1 N/A MLPClassifier alpha 1 N/A AdaBoostClassifier N/A GaussianNB N/A QuadraticDiscriminantAnalysis N/A N/A X y N/A make_classification n_features 2 n_redundant 0 n_informative 2 random_state 1 n_clusters_per_class 1 N/A rng N/A N/A N/A np random RandomState 2 N/A X N/A 2 N/A N/A rng uniform size N/A X shape N/A linearly_separable N/A X y N/A datasets N/A N/A make_moons noise 0.3 random_state 0 N/A make_circles noise 0.2 factor 0.5 random_state 1 linearly_separable N/A figure N/A N/A plt figure figsize N/A 27 9 N/A i 1 N/A N/A ds_cnt ds N/A enumerate datasets N/A N/A N/A X y ds N/A X N/A N/A N/A StandardScaler fit_transform X N/A N/A X_train X_test y_train y_test N/A train_test_split X y test_size 0.4 random_state 42 N/A N/A x_min x_max N/A N/A N/A N/A N/A X N/A N/A N/A 0 min 0.5 N/A N/A N/A N/A X N/A N/A N/A 0 max 0.5 N/A N/A y_min y_max N/A N/A N/A N/A N/A X N/A N/A N/A 1 min 0.5 N/A N/A N/A N/A X N/A N/A N/A 1 max 0.5 N/A N/A xx yy N/A N/A np meshgrid N/A N/A np arange x_min x_max h N/A N/A np arange y_min y_max h N/A cm N/A N/A plt cm RdBu N/A cm_bright N/A ListedColormap N/A #FF0000 #0000FF N/A ax N/A N/A plt subplot N/A len datasets N/A N/A len classifiers 1 i N/A N/A ds_cnt 0 N/A N/A N/A N/A ax set_title Input data N/A N/A N/A ax scatter N/A X_train N/A N/A N/A 0 N/A X_train N/A N/A N/A 1 c y_train cmap cm_bright N/A N/A N/A ax scatter N/A X_test N/A N/A N/A 0 N/A X_test N/A N/A N/A 1 c y_test cmap cm_bright alpha 0.6 N/A N/A N/A ax set_xlim N/A N/A xx min N/A N/A xx max N/A N/A N/A ax set_ylim N/A N/A yy min N/A N/A yy max N/A N/A N/A ax set_xticks N/A N/A N/A N/A ax set_yticks N/A N/A i 1 N/A N/A name clf N/A zip names classifiers N/A N/A ax N/A N/A plt subplot N/A len datasets N/A N/A len classifiers 1 i N/A N/A N/A clf fit X_train y_train N/A score N/A N/A clf score X_test y_test N/A N/A hasattr clf decision_function N/A N/A Z N/A N/A clf decision_function N/A N/A np c_ N/A N/A N/A N/A xx ravel N/A N/A yy ravel N/A N/A Z N/A N/A N/A clf predict_proba N/A N/A np c_ N/A N/A N/A N/A xx ravel N/A N/A yy ravel N/A N/A N/A 1 N/A Z N/A N/A Z reshape N/A xx shape N/A N/A N/A ax contourf xx yy Z cmap cm alpha 0.8 N/A N/A N/A ax scatter N/A X_train N/A N/A N/A 0 N/A X_train N/A N/A N/A 1 c y_train cmap cm_bright N/A N/A N/A ax scatter N/A X_test N/A N/A N/A 0 N/A X_test N/A N/A N/A 1 c y_test cmap cm_bright alpha 0.6 N/A N/A N/A ax set_xlim N/A N/A xx min N/A N/A xx max N/A N/A N/A ax set_ylim N/A N/A yy min N/A N/A yy max N/A N/A N/A ax set_xticks N/A N/A N/A N/A ax set_yticks N/A N/A N/A ds_cnt 0 N/A N/A N/A N/A ax set_title name N/A N/A N/A ax text N/A N/A N/A xx max 0.3 N/A N/A N/A yy min 0.3 N/A N/A N/A %.2f score lstrip 0 size 15 horizontalalignment right N/A i 1 N/A N/A N/A plt tight_layout N/A N/A N/A plt show