#NEWLINE# def make_xy( self , on , off ) : #NEWLINE# #INDENT# x = [ ] #NEWLINE# y = [ ] #NEWLINE# for o in on : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# x . append ( self . extractor ( * o ) . reshape ( 1 , ( - 1 ) ) ) #NEWLINE# y . append ( 1 ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# for o in off : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# x . append ( self . extractor ( * o ) . reshape ( 1 , ( - 1 ) ) ) #NEWLINE# y . append ( 0 ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# x = np . vstack ( x ) #NEWLINE# y = np . hstack ( y ) #NEWLINE# if ( not np . isfinite ( x ) . all ( ) ) : #NEWLINE# #INDENT# warnings . warn ( 'Non-finite values in feature vectors. Fixing' ) #NEWLINE# x = np . nan_to_num ( x ) #NEWLINE# #UNINDENT# assert ( x . shape [ 0 ] == y . shape [ 0 ] ) #NEWLINE# assert ( x . ndim == 2 ) #NEWLINE# assert ( y . ndim == 1 ) #NEWLINE# return ( x , y )