<s> from pylab import * <EOL> from numpy import * <EOL> import pickle <EOL> from PCV . classifiers import knn <EOL> from PCV . tools import imtools <EOL> """<STR_LIT>""" <EOL> with open ( '<STR_LIT>' , '<STR_LIT:r>' ) as f : <EOL> class_1 = pickle . load ( f ) <EOL> class_2 = pickle . load ( f ) <EOL> labels = pickle . load ( f ) <EOL> model = knn . KnnClassifier ( labels , vstack ( ( class_1 , class_2 ) ) ) <EOL> with open ( '<STR_LIT>' , '<STR_LIT:r>' ) as f : <EOL> class_1 = pickle . load ( f ) <EOL> class_2 = pickle . load ( f ) <EOL> labels = pickle . load ( f ) <EOL> print model . classify ( class_1 [ <NUM_LIT:0> ] ) <EOL> def classify ( x , y , model = model ) : <EOL> return array ( [ model . classify ( [ xx , yy ] ) for ( xx , yy ) in zip ( x , y ) ] ) <EOL> imtools . plot_2D_boundary ( [ - <NUM_LIT:6> , <NUM_LIT:6> , - <NUM_LIT:6> , <NUM_LIT:6> ] , [ class_1 , class_2 ] , classify , [ <NUM_LIT:1> , - <NUM_LIT:1> ] ) <EOL> show ( ) </s>
