dict
This commit is contained in:
parent
d733b980ba
commit
69d0c1b557
5 changed files with 607 additions and 31 deletions
40
untitled21.py
Normal file
40
untitled21.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
#!/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)
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue