<s> """<STR_LIT>""" <EOL> print ( __doc__ ) <EOL> import numpy as np <EOL> import matplotlib . pyplot as plt <EOL> from sklearn import linear_model <EOL> xmin , xmax = - <NUM_LIT:5> , <NUM_LIT:5> <EOL> n_samples = <NUM_LIT:100> <EOL> np . random . seed ( <NUM_LIT:0> ) <EOL> X = np . random . normal ( size = n_samples ) <EOL> y = ( X > <NUM_LIT:0> ) . astype ( np . float ) <EOL> X [ X > <NUM_LIT:0> ] *= <NUM_LIT:4> <EOL> X += <NUM_LIT> * np . random . normal ( size = n_samples ) <EOL> X = X [ : , np . newaxis ] <EOL> clf = linear_model . LogisticRegression ( C = <NUM_LIT> ) <EOL> clf . fit ( X , y ) <EOL> plt . figure ( <NUM_LIT:1> , figsize = ( <NUM_LIT:4> , <NUM_LIT:3> ) ) <EOL> plt . clf ( ) <EOL> plt . scatter ( X . ravel ( ) , y , color = '<STR_LIT>' , zorder = <NUM_LIT:20> ) <EOL> X_test = np . linspace ( - <NUM_LIT:5> , <NUM_LIT:10> , <NUM_LIT> ) <EOL> def model ( x ) : <EOL> return <NUM_LIT:1> / ( <NUM_LIT:1> + np . exp ( - x ) ) <EOL> loss = model ( X_test * clf . coef_ + clf . intercept_ ) . ravel ( ) <EOL> plt . plot ( X_test , loss , color = '<STR_LIT>' , linewidth = <NUM_LIT:3> ) <EOL> ols = linear_model . LinearRegression ( ) <EOL> ols . fit ( X , y ) <EOL> plt . plot ( X_test , ols . coef_ * X_test + ols . intercept_ , linewidth = <NUM_LIT:1> ) <EOL> plt . axhline ( <NUM_LIT> , color = '<STR_LIT>' ) <EOL> plt . ylabel ( '<STR_LIT:y>' ) <EOL> plt . xlabel ( '<STR_LIT:X>' ) <EOL> plt . xticks ( ( ) ) <EOL> plt . yticks ( ( ) ) <EOL> plt . ylim ( - <NUM_LIT> , <NUM_LIT> ) <EOL> plt . xlim ( - <NUM_LIT:4> , <NUM_LIT:10> ) <EOL> plt . show ( ) </s>
