<s> import numpy as np <EOL> from sklearn import linear_model <EOL> import matplotlib . pyplot as plt <EOL> def f ( x ) : <EOL> return x + np . random . random ( ) * <NUM_LIT> <EOL> X = np . arange ( <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:0.5> ) <EOL> X = X . reshape ( ( len ( X ) , <NUM_LIT:1> ) ) <EOL> y = map ( f , X ) <EOL> clf = linear_model . LinearRegression ( ) <EOL> clf . fit ( X , y ) <EOL> new_X = np . arange ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> new_X = new_X . reshape ( ( len ( new_X ) , <NUM_LIT:1> ) ) <EOL> new_y = clf . predict ( new_X ) <EOL> plt . scatter ( X , y , color = '<STR_LIT:g>' , label = '<STR_LIT>' ) <EOL> plt . plot ( new_X , new_y , '<STR_LIT>' , label = '<STR_LIT>' ) <EOL> plt . legend ( ) <EOL> plt . show ( ) </s>
