import numpy as np from sklearn import datasets from sklearn import metrics from matplotlib import pylab as plt # generate some 2D data set, 2 classes # check the help for 'datasets.make_classification' function X, y = datasets.make_classification(1000, n_features=2, weights=[0.4,0.6], n_informative=2, n_redundant=0, n_clusters_per_class=1, flip_y=0.01, shuffle=True) plt.scatter(X[:,0], X[:,1], c=y, cmap=plt.cm.Paired) from sklearn.linear_model import Perceptron # -check the documentation and train/test a model