<s> import matplotlib . pyplot as plt <EOL> import numpy as np <EOL> from sklearn . svm import SVC <EOL> from sklearn . datasets import make_blobs <EOL> def plot_linear_svc_regularization ( ) : <EOL> X , y = make_blobs ( centers = <NUM_LIT:2> , random_state = <NUM_LIT:4> , n_samples = <NUM_LIT:30> ) <EOL> fig , axes = plt . subplots ( <NUM_LIT:1> , <NUM_LIT:3> , figsize = ( <NUM_LIT:12> , <NUM_LIT:4> ) ) <EOL> y [ <NUM_LIT:7> ] = <NUM_LIT:0> <EOL> y [ <NUM_LIT> ] = <NUM_LIT:0> <EOL> x_min , x_max = X [ : , <NUM_LIT:0> ] . min ( ) - <NUM_LIT> , X [ : , <NUM_LIT:0> ] . max ( ) + <NUM_LIT> <EOL> y_min , y_max = X [ : , <NUM_LIT:1> ] . min ( ) - <NUM_LIT> , X [ : , <NUM_LIT:1> ] . max ( ) + <NUM_LIT> <EOL> for ax , C in zip ( axes , [ <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT> ] ) : <EOL> ax . scatter ( X [ : , <NUM_LIT:0> ] , X [ : , <NUM_LIT:1> ] , s = <NUM_LIT> , c = np . array ( [ '<STR_LIT>' , '<STR_LIT>' ] ) [ y ] ) <EOL> svm = SVC ( kernel = '<STR_LIT>' , C = C , tol = <NUM_LIT> ) . fit ( X , y ) <EOL> w = svm . coef_ [ <NUM_LIT:0> ] <EOL> a = - w [ <NUM_LIT:0> ] / w [ <NUM_LIT:1> ] <EOL> xx = np . linspace ( <NUM_LIT:6> , <NUM_LIT> ) <EOL> yy = a * xx - ( svm . intercept_ [ <NUM_LIT:0> ] ) / w [ <NUM_LIT:1> ] <EOL> ax . plot ( xx , yy , label = "<STR_LIT>" % C , c = '<STR_LIT:k>' ) <EOL> ax . set_xlim ( x_min , x_max ) <EOL> ax . set_ylim ( y_min , y_max ) <EOL> ax . set_xticks ( ( ) ) <EOL> ax . set_yticks ( ( ) ) <EOL> ax . set_title ( "<STR_LIT>" % C ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> plot_linear_svc_regularization ( ) <EOL> plt . show ( ) </s>
