KNN_best_model,KNN_best_params = KNN_RandSearch.RandomSearch()

# Run the best model pipeline
models = f.GetScaledModelwithbestparams('standard',
                                        LR_best_params,
                                        Ad_best_params,
                                        GB_best_params,
                                        RF_best_params,
                                        CART_best_params,
                                        KNN_best_params)

names, results = f.cv_score(X_train,y_train,models,['accuracy',
                                                    'specificity_cl_1',
                                                    'precision_cl_1',
                                                    'recall_cl_1',
                                                    'specificity_cl_2',
                                                    'precision_cl_2',
                                                    'recall_cl_2',
                                                    'AUC_cl_1',
                                                    'AUC_cl_2',
                                                    'MCC'])

ScoreCard = f.concat_model_score(names, results, ScoreCard)

results_df = pd.DataFrame(results, index = names)


# HYPER PARAMETER TUNING WITH GRID SEARCH for best performing models

# Logistic Regression model
penalty = ['l1', 'l2']
 def scaled_model_with_CW_factor(self, scoring, SEED, scalar):
     models = f.GetScaledModelwithfactorizedCW(scalar)
     names, results = f.cv_score(self.X_train, self.y_train, models,
                                 scoring, SEED)
     _score = f.cv_metrics(names, results)
     return _score