saving work

This commit is contained in:
Tanushree Tunstall 2022-06-24 13:21:21 +01:00
parent 3514e1b4ba
commit ad99efedd7
5 changed files with 46 additions and 507 deletions

View file

@ -99,13 +99,11 @@ rskf_cv = RepeatedStratifiedKFold(n_splits = 10
mcc_score_fn = {'mcc': make_scorer(matthews_corrcoef)}
jacc_score_fn = {'jcc': make_scorer(jaccard_score)}
#FIXME
#====================
# Import ProcessFunc
#====================
from ProcessMultModelsCl import *
#from ProcessMultModelCl import *
#%%
# Multiple Classification - Model Pipeline
def MultModelsCl(input_df, target, skf_cv
@ -275,10 +273,10 @@ def MultModelsCl(input_df, target, skf_cv
btyn_pos = btyn[1]
# Build dict
tbtD = {'trainingY_neg' : tyn_neg
, 'trainingY_pos' : tyn_pos
, 'blindY_neg' : btyn_neg
, 'blindY_pos' : btyn_pos}
tbtD = {'n_trainingY_neg' : tyn_neg
, 'n_trainingY_pos' : tyn_pos
, 'n_blindY_neg' : btyn_neg
, 'n_blindY_pos' : btyn_pos}
#---------------------------------
# Update cv dict with cmD and tbtD
@ -337,15 +335,15 @@ def MultModelsCl(input_df, target, skf_cv
yc2 = Counter(blind_test_target)
yc2_ratio = yc2[0]/yc2[1]
mm_skf_scoresD[model_name]['resampling'] = resampling_type
mm_skf_scoresD[model_name]['resampling'] = resampling_type
mm_skf_scoresD[model_name]['training_size'] = len(input_df)
mm_skf_scoresD[model_name]['trainingY_ratio'] = round(yc1_ratio, 2)
mm_skf_scoresD[model_name]['n_training_size'] = len(input_df)
mm_skf_scoresD[model_name]['n_trainingY_ratio'] = round(yc1_ratio, 2)
mm_skf_scoresD[model_name]['testSize'] = len(blind_test_df)
mm_skf_scoresD[model_name]['testY_ratio'] = round(yc2_ratio,2)
mm_skf_scoresD[model_name]['n_features'] = len(input_df.columns)
mm_skf_scoresD[model_name]['tts_split'] = tts_split_type
mm_skf_scoresD[model_name]['n_blind_test_size'] = len(blind_test_df)
mm_skf_scoresD[model_name]['n_testY_ratio'] = round(yc2_ratio,2)
mm_skf_scoresD[model_name]['n_features'] = len(input_df.columns)
mm_skf_scoresD[model_name]['tts_split'] = tts_split_type
#return(mm_skf_scoresD)
#============================