def show_improved_model_performances(dframe): print('\nCalculating improved models performances:') train, test = preprocess.get_train_test_split(dframe) test_x = preprocess.get_featues(test) test_y = preprocess.get_label(test) show_models_performances([ get_model(RandomForestModel()), get_model(LogisticRegressionModel()), get_model(SVM()), get_model_keras() ], test_x, test_y)
def show_benchmark_model_performance(): print('Calculating benchmark model performance:') dframe = preprocess.read_processed_data(constants.RAW_DATA_PICKLE) train, test = preprocess.get_train_test_split(dframe) test_x = preprocess.get_featues(test) test_y = preprocess.get_label(test) model = SVM() model_file = os.path.join(constants.PROJ_ROOT, 'models', 'benchmark', model.name + '.model') model.load(model_file) show_models_performances([model], test_x, test_y, roc_file=constants.BENCHMARK_ROC_PATH)
def train(self, train, validation): X = get_featues(train) y = get_label(train) xv = get_featues(validation) yv = get_label(validation) self.clf.fit(X, y, epochs=500, verbose=0, validation_data=(xv, yv))
def train(self, dframe): X = get_featues(dframe) y = get_label(dframe) self.clf.fit(X, y)