40 lines
No EOL
916 B
Python
40 lines
No EOL
916 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
Created on Thu Mar 10 18:06:34 2022
|
|
|
|
@author: tanu
|
|
"""
|
|
models = [
|
|
('Logistic Regression' , log_reg)
|
|
, ('K-Nearest Neighbors', knn)
|
|
]
|
|
|
|
classification_metrics = {
|
|
'F1_score': []
|
|
,'MCC': []
|
|
,'Precision': []
|
|
,'Recall': []
|
|
,'Accuracy': []
|
|
,'ROC_curve': []
|
|
}
|
|
|
|
folds=[1,2]
|
|
fold_no=1
|
|
fold_dict={}
|
|
for model_name, model in models:
|
|
fold_dict.update({model_name: {}})
|
|
|
|
for f in folds:
|
|
fold=("fold_"+str(fold_no))
|
|
for model_name, model in models:
|
|
print("start of model", model_name, "fold: ", fold)
|
|
fold_dict[model_name].update({fold: {}})
|
|
fold_dict[model_name][fold].update(classification_metrics)
|
|
|
|
print("end of model", model_name, "fold: ", fold)
|
|
fold_dict[model_name][fold].update({'F1_score': random.randrange(1,10)})
|
|
fold_no +=1
|
|
pp.pprint(fold_dict)
|
|
|
|
|