def generate_submission(predictions, id_column, target_column, id_values, save_path): submission_df = pd.DataFrame({ id_column: id_values, target_column: predictions }) submission_df.to_csv(create_path(save_path, 'submission.csv'), index=False)
def create_stack_pred(self): stack_df = pd.DataFrame.from_records(self.predictions) prediction_column = self.generate_prediction_column_name('Prediction') stack_df.set_axis(['Fold', prediction_column], axis=1, inplace=True) stack_df.to_csv( create_path(self.save_path, 'stack.csv'), index=False )
def set_model_config(self, config_folder): config_path = create_path(config_folder, 'config.json') config = load_json(config_path) self.ml_model.set_config(config)
def save_best_config(self, best_config): save_path = create_path(self.save_path, 'best_config.json') save_json(save_path, best_config)
def get_variables_distribution(self): tuning_json_path = create_path(self.save_path, 'tuning.json') parser = TuningParser(tuning_json_path) return parser.parse_json()