#NEWLINE# def __init__( self , input_csv , match_filename , train_columns = [ ] , max_size = ( - 1 ) ) : #NEWLINE# #INDENT# self . _raw = pd . DataFrame ( ) #NEWLINE# self . _match_filename = match_filename #NEWLINE# self . _current_matches = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . _guess = None #NEWLINE# self . _positive = pd . DataFrame ( ) #NEWLINE# self . _negative = pd . DataFrame ( ) #NEWLINE# self . _train_cols = train_columns #NEWLINE# self . _stamp = datetime . datetime . now ( ) . strftime ( '%Y-%m-%d-%H:%M:%S' ) #NEWLINE# print ( ( 'Searching for ' + ( '%s.*' % match_filename ) ) ) #NEWLINE# self . _old_matches = load_mapping ( match_filename ) #NEWLINE# print ( ( 'Reading %i' % max_size ) ) #NEWLINE# if input_csv : #NEWLINE# #INDENT# for ii in input_csv : #NEWLINE# #INDENT# new_data = self . read_data ( ii , self . _old_matches , max_size ) #NEWLINE# self . _raw = self . _raw . append ( new_data ) #NEWLINE# #UNINDENT# self . _raw = self . add_derived_columns ( self . _raw ) #NEWLINE# for ii in self . _old_matches : #NEWLINE# #INDENT# self . add_training ( ii , self . _old_matches [ ii ] ) #NEWLINE# #UNINDENT# self . clean_data ( )