parameters: (self)
return_statement: return self.model_map
docstring: Train the ou-models
  
          :return: the map of the trained models
docstring_summary: Train the ou-models
docstring_tokens: Train the ou - models
function: def train(self):
          """Train the ou-models
  
          :return: the map of the trained models
          """
  
          self.model_map = {}
  
          # Create the results files for the paper
          header = ["OpUnit", "Method"] + [target.name for target in data_info.instance.OU_MODEL_TARGET_LIST]
          summary_file = "{}/ou_runner.csv".format(self.model_metrics_path)
          io_util.create_csv_file(summary_file, header)
  
          # First get the data for all ou runners
          for filename in sorted(glob.glob(os.path.join(self.input_path, '*.csv'))):
              print(filename)
              data_list = opunit_data.get_ou_runner_data(filename, self.model_metrics_path, self.txn_sample_rate,
                                                           self.model_map, self.stats_map, self.trim)
              for data in data_list:
                  best_y_transformer, best_method = self.train_data(data, summary_file)
                  if self.expose_all:
                      self.train_specific_model(data, best_y_transformer, best_method)
  
          return self.model_map
function_tokens: def train ( self ) : self . model_map = { } # Create the results files for the paper header = [ "OpUnit" , "Method" ] + [ target . name for target in data_info . instance . OU_MODEL_TARGET_LIST ] summary_file = "{}/ou_runner.csv" . format ( self . model_metrics_path ) io_util . create_csv_file ( summary_file , header ) # First get the data for all ou runners for filename in sorted ( glob . glob ( os . path . join ( self . input_path , '*.csv' ) ) ) : print ( filename ) data_list = opunit_data . get_ou_runner_data ( filename , self . model_metrics_path , self . txn_sample_rate , self . model_map , self . stats_map , self . trim ) for data in data_list : best_y_transformer , best_method = self . train_data ( data , summary_file ) if self . expose_all : self . train_specific_model ( data , best_y_transformer , best_method ) return self . model_map