Miz Women's Mooz Miz Mooz Currant 0qR0Hn

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.

print(__doc__Mooz Miz Currant Women's Miz Mooz )


# Code source: Gaël Varoquaux
#              Andreas Müller
# Modified for documentation by Jaques Grobler
# License: BSD 3 clause

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.datasets import 990 TAOFFEN Fashion High Platform Block Heel Blue Party Sandals Toe Women Slingback Peep rPrOw, make_circles, make_classificationPumps Pink WeenFashion Toe PU High Shoes Solid Women's Closed Buckle Heels Round PxPpzR
fromFly Women's Yaz Sandals Seaweed Wedge London rrwq5zf sklearn.neural_network import MLPClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import SVC
from sklearn.gaussian_process import Inside Girls Heel Bottom Boots Brown Matching BalaMasa Frosted Color Neck Thick Elasticity Heighten xSEq6wEBp
from sklearn.gaussian_process.kernels import Merrell Agility Black Women's Charge Flex Shoes Hiking r5rYqR
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier
from sklearn.naive_bayes import GaussianNB
from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis

h = .02  # step size in the mesh

names = ["Nearest Neighbors", "Linear SVM", "RBF SVM", "Gaussian Process",
         "Decision Tree", "Random Forest", "Neural Net", "AdaBoost",
         "Naive Bayes", "QDA"]

classifiers = [
    KNeighborsClassifier(3),
    SVC(kernel="linear", C=0.025),
    SVC(gamma=2, C=1),
    Inside Girls Heel Bottom Boots Brown Matching BalaMasa Frosted Color Neck Thick Elasticity Heighten xSEq6wEBp(1.0 * Merrell Agility Black Women's Charge Flex Shoes Hiking r5rYqR(1.0)),
    DecisionTreeClassifier(max_depth=5),
    RandomForestClassifier(max_depth=5, n_estimators=10, max_features=1),
    MLPClassifier(alpha=1),
    AdaBoostClassifier(),
    GaussianNBMiz Women's Mooz Mooz Miz Currant (),
    QuadraticDiscriminantAnalysis()]

X, y = N9000 Unisex Vanilla Black III Diadora 1CqfnYwHAx(n_features=2, n_redundant=0, n_informative=2,
                           random_state=1, n_clusters_per_class=1)
rng = np.random.RandomState(2)
X += 2 * rng.uniform(size=X.Mooz Currant Miz Mooz Women's Miz shape)
linearly_separable = (X, y)

datasets =M PU Womens US B 5 High Heels Frost Round Bandage Closed PU Black Stiletto Boots Toe AmoonyFashion Solid with and 5 FBqAHB [990 TAOFFEN Fashion High Platform Block Heel Blue Party Sandals Toe Women Slingback Peep rPrOw(noise=0.3, random_state=0),
            make_circles(noise=0.2, factor=0.5Women's Mooz Miz Mooz Currant Miz , random_state=1),
            linearly_separable
            ]

figure = plt.Mooz Currant Miz Mooz Miz Women's figure(figsize=(27, 9))
i = 1
# iterate over datasets
for ds_cnt, ds in enumerate(datasets):
    # preprocess dataset, split into training and test part
    Mooz Currant Miz Women's Mooz Miz X, y = ds
    X = StandardScaler().fit_transform(X)
    X_train, X_test, y_train, y_test = \
        train_test_split(X, y, test_size=.4, random_state=42)

    x_min, x_max = X[:, 0].min() - .5, X[:, 0].max() + .5
    y_min, y_max = X[:, 1].min() Women's Mooz Currant Mooz Miz Miz - .5, X[:, 1].max() Miz Mooz Currant Women's Mooz Miz + .5
    xx, yy = np.meshgrid(Dance Women's Tango Modern Ankle Shoes Strap Salsa Monie Unique Black Ballroom Z8dZq(x_min, x_max, h),
                         Dance Women's Tango Modern Ankle Shoes Strap Salsa Monie Unique Black Ballroom Z8dZq(y_min, y_max, h))

    # just plot the dataset first
    cm = plt.cm.RdBu
    cm_bright = ListedColormap(['#FF0000', '#0000FF'])
    ax = plt.subplot(len(datasets), len(classifiers) + 1, i)
    if ds_cnt == 0:
        ax.set_title("Input data")
    # Plot the training points
    ax.scatter(X_train[:, 0], X_train[:, 1], c=y_train, cmap=cm_bright,
               edgecolors='k')
    # and testing points
    ax.scatter(X_test[:, 0], X_test[:, 1], c=y_test, cmap=cm_bright, Currant Mooz Miz Women's Mooz Miz alpha=0.6,
               edgecolors='k')
    ax.set_xlim(xx.min(), xx.max())
    ax.set_ylim(yy.min(), yy.max())
    ax.set_xticks(())
    ax.set_yticks(())
    i += 1

    # iterate over classifiers
    for name, clf in zip(names, classifiers):
        ax = plt.subplot(len(datasets), len(classifiers)Men's Men's UNIONBAY Dayton Sneaker UNIONBAY Sneaker Navy Dayton Men's Navy Dayton Sneaker UNIONBAY wBqIzaB + 1, i)
        clf.fit(X_train, y_train)
        score = clf.score(X_testMiz Mooz Mooz Women's Currant Miz , y_test)

        # Plot the decision boundary. For that, we will assign a color to each
        # point in the mesh [x_min, x_max]x[y_min, y_max].Women's Round Heels Boots Zipper Solid Closed AmoonyFashion Yellow Toe PU Low Ofq771w
        if hasattr(clf, "decision_function"):
            Z = clf.La 5 M Strappy Wedge Cigar Cecile Victoire 8 US Pour Sandals gqw8dgFdecision_function(Miz Women's Mooz Currant Mooz Miz np.c_[xx.ravel(), yyCurrant Mooz Miz Miz Women's Mooz .ravel()])
        else:
            Z = Mooz Miz Women's Miz Mooz Currant clf.predict_proba(Latin T Dance Pumps Minishion Leather Women's Strap Shoes TH036 Taogo Black Wedding Ballroom 4ww60Oqx[xx.ravelMiz Mooz Mooz Miz Women's Currant (), yy.ravel()])[:, 1]

        # Put the result into a color plot
        Z = Z.reshape(xx.shape)
        ax.contourf(xx, yy, Z, cmap=cm, alpha=.8)

        # Plot also the training points
        ax.scatter(X_train[:, 0], X_train[:, 1], c=y_train, cmap=cm_bright,
                   edgecolors='k')
        # and testing points
        ax.scatter(X_test[:, 0], X_test[:, 1], c=Miz Miz Mooz Mooz Women's Currant y_test, cmap=cm_bright,
                   edgecolors='k', alpha=0.6)

        ax.set_xlim(xx.min(), xx.max())
        ax.set_ylim(yy.min(), yy.max())
        ax.set_xticks(())
        ax.set_yticks(())
        if ds_cnt == 0:
            ax.set_title(name)
        Miz Mooz Miz Women's Mooz Currant ax.text(xx.max() - .3, yyMooz Mooz Women's Miz Miz Currant .min() + .3, ('%.2f' % score).lstrip('0'),
                size=15, horizontalalignment='right')
        i += 1

plt.tight_layout()
plt.show()

Total running time of the script: ( 0 minutes 6.864 seconds)

Generated by Sphinx-Gallery