<s> from udl . caffei . models . logistic import Logistic <EOL> import sklearn <EOL> import sklearn . datasets <EOL> import sklearn . linear_model <EOL> from sklearn . metrics import accuracy_score <EOL> def get_data ( ) : <EOL> X , Y = sklearn . datasets . make_classification ( <EOL> n_samples = <NUM_LIT> , n_features = <NUM_LIT:4> , n_redundant = <NUM_LIT:0> , n_informative = <NUM_LIT:2> , <EOL> n_clusters_per_class = <NUM_LIT:2> , hypercube = False , random_state = <NUM_LIT:0> <EOL> ) <EOL> X , Xt , Y , Yt = sklearn . cross_validation . train_test_split ( X , Y ) <EOL> return X , Xt , Y , Yt <EOL> clf_caffe = Logistic ( ) <EOL> X , Xt , Y , Yt = get_data ( ) <EOL> clf = sklearn . linear_model . SGDClassifier ( loss = '<STR_LIT>' , n_iter = <NUM_LIT:1000> , penalty = '<STR_LIT>' , alpha = <NUM_LIT> , class_weight = '<STR_LIT>' ) <EOL> clf . fit ( X , Y ) <EOL> yt_pred = clf . predict ( Xt ) <EOL> print yt_pred <EOL> print ( '<STR_LIT>' . format ( sklearn . metrics . accuracy_score ( Yt , yt_pred ) ) ) <EOL> clf = Logistic ( ) <EOL> clf . fit ( X , Y ) <EOL> pred = clf . predict ( Xt ) <EOL> accuracy = accuracy_score ( Yt , pred ) <EOL> print ( '<STR_LIT>' . format ( sklearn . metrics . accuracy_score ( Yt , yt_pred ) ) ) <EOL> print ( "<STR_LIT>" . format ( accuracy ) ) </s>
