コード例 #1
0
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)
コード例 #2
0
 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
     )
コード例 #3
0
    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)
コード例 #4
0
 def save_best_config(self, best_config):
     save_path = create_path(self.save_path, 'best_config.json')
     save_json(save_path, best_config)
コード例 #5
0
    def get_variables_distribution(self):
        tuning_json_path = create_path(self.save_path, 'tuning.json')

        parser = TuningParser(tuning_json_path)
        return parser.parse_json()