<s> import scipy . io as sio <EOL> import matplotlib . pyplot as plt <EOL> import numpy as np <EOL> from sklearn . linear_model import LogisticRegression <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> data = sio . loadmat ( '<STR_LIT>' ) <EOL> y = data [ '<STR_LIT:y>' ] <EOL> X = data [ '<STR_LIT:X>' ] <EOL> y = y % <NUM_LIT:10> <EOL> n_sampels = <NUM_LIT:100> <EOL> sampels = np . random . choice ( len ( X ) , n_sampels ) <EOL> fig = plt . figure ( figsize = ( <NUM_LIT:8> , <NUM_LIT:8> ) ) <EOL> fig . subplots_adjust ( left = <NUM_LIT:0> , right = <NUM_LIT:1> , bottom = <NUM_LIT:0> , top = <NUM_LIT:1> , hspace = <NUM_LIT> , wspace = <NUM_LIT> ) <EOL> for i , j in enumerate ( sampels ) : <EOL> ax = fig . add_subplot ( <NUM_LIT:10> , <NUM_LIT:10> , i + <NUM_LIT:1> , xticks = [ ] , yticks = [ ] ) <EOL> ax . imshow ( X [ j , : ] . reshape ( <NUM_LIT:20> , <NUM_LIT:20> ) . T , cmap = plt . cm . binary , interpolation = '<STR_LIT>' ) <EOL> ax . text ( <NUM_LIT:0> , <NUM_LIT:7> , str ( y [ j , <NUM_LIT:0> ] ) ) <EOL> plt . show ( ) <EOL> y = y . ravel ( ) <EOL> lr = LogisticRegression ( C = <NUM_LIT:100> ) <EOL> lr . fit ( X , y ) <EOL> print '<STR_LIT>' . format ( lr . score ( X , y ) * <NUM_LIT:100> ) <EOL> lr = LogisticRegression ( C = <NUM_LIT:10> ) <EOL> lr . fit ( X , y ) <EOL> print '<STR_LIT>' . format ( lr . score ( X , y ) * <NUM_LIT:100> ) </s>
