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 Assign NameStore Call NameLoad keyword Str keyword Num keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr For TupleStore TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad body Assign NameStore NameLoad Assign NameStore SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index Num Assign NameStore ListLoad Num Num Num Assign NameStore ListLoad Str Str Str Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num SubscriptLoad NameLoad ExtSlice Slice Index Num keyword NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr
N/A N/A 
=========================================
SGD: Maximum margin separating hyperplane
=========================================

Plot the maximum margin separating hyperplane within a two-class
separable dataset using a linear Support Vector Machines classifier
trained using SGD.
 N/A __doc__ N/A numpy np N/A pylab pl sklearn.linear_model SGDClassifier sklearn.datasets.samples_generator make_blobs N/A N/A X Y N/A make_blobs n_samples 50 centers 2 random_state 0 cluster_std 0.6 N/A clf N/A SGDClassifier loss hinge alpha 0.01 n_iter 200 fit_intercept True N/A N/A N/A clf fit X Y N/A xx N/A N/A np linspace -1 5 10 N/A yy N/A N/A np linspace -1 5 10 N/A N/A X1 X2 N/A N/A np meshgrid xx yy N/A Z N/A N/A np empty N/A X1 shape N/A N/A N/A i j val N/A N/A np ndenumerate X1 N/A N/A x1 val N/A x2 N/A X2 N/A N/A i j N/A p N/A N/A clf decision_function N/A x1 x2 N/A N/A Z N/A N/A i j N/A p N/A 0 N/A levels N/A -1.0 0.0 1.0 N/A linestyles N/A dashed solid dashed N/A colors k N/A N/A N/A pl contour X1 X2 Z levels colors colors linestyles linestyles N/A N/A N/A pl scatter N/A X N/A N/A N/A 0 N/A X N/A N/A N/A 1 c Y cmap N/A N/A pl cm Paired N/A N/A N/A pl axis tight N/A N/A N/A pl show