<s> """<STR_LIT>""" <EOL> print __doc__ <EOL> import numpy as np <EOL> import pylab as pl <EOL> from sklearn . linear_model import SGDClassifier <EOL> from sklearn . datasets . samples_generator import make_blobs <EOL> X , Y = make_blobs ( n_samples = <NUM_LIT:50> , centers = <NUM_LIT:2> , random_state = <NUM_LIT:0> , cluster_std = <NUM_LIT> ) <EOL> clf = SGDClassifier ( loss = "<STR_LIT>" , alpha = <NUM_LIT> , n_iter = <NUM_LIT:200> , fit_intercept = True ) <EOL> clf . fit ( X , Y ) <EOL> xx = np . linspace ( - <NUM_LIT:1> , <NUM_LIT:5> , <NUM_LIT:10> ) <EOL> yy = np . linspace ( - <NUM_LIT:1> , <NUM_LIT:5> , <NUM_LIT:10> ) <EOL> X1 , X2 = np . meshgrid ( xx , yy ) <EOL> Z = np . empty ( X1 . shape ) <EOL> for ( i , j ) , val in np . ndenumerate ( X1 ) : <EOL> x1 = val <EOL> x2 = X2 [ i , j ] <EOL> p = clf . decision_function ( [ x1 , x2 ] ) <EOL> Z [ i , j ] = p [ <NUM_LIT:0> ] <EOL> levels = [ - <NUM_LIT:1.0> , <NUM_LIT:0.0> , <NUM_LIT:1.0> ] <EOL> linestyles = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> colors = '<STR_LIT:k>' <EOL> pl . contour ( X1 , X2 , Z , levels , colors = colors , linestyles = linestyles ) <EOL> pl . scatter ( X [ : , <NUM_LIT:0> ] , X [ : , <NUM_LIT:1> ] , c = Y , cmap = pl . cm . Paired ) <EOL> pl . axis ( '<STR_LIT>' ) <EOL> pl . show ( ) </s>
