def formatKaggleSubmission(predictions, model_id): # predictions is dataframe containing test data set predictions created # by the ModelTrainer() # returns submission dataframe with correctly formatted submission data set # # # get parameters # from msw.model_stacking import getConfigParameters CONFIG = getConfigParameters() submission = predictions[CONFIG['ID_VAR']].join(predictions[model_id + '_1']) submission.columns = CONFIG['KAGGLE_SUBMISSION_HEADERS'] return submission
#%% from msw.model_stacking import FeatureGenerator, getConfigParameters #%% import os.path import pandas as pd import numpy as np #%% # # get parameters # CONFIG = getConfigParameters() print('root dir: ',CONFIG['ROOT_DIR']) #%% # # Define Feature Generator for Level 1 # class FeatureGeneratorNextLevel(FeatureGenerator): # # override getRawData() method to handle retrieval of prior # model predictions # def getRawData(self):