Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
C
covid_analysis
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
COMPARA
covid_analysis
Commits
c04dcc50
Commit
c04dcc50
authored
May 13, 2024
by
Joaquin Torres
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checking results for DT
parent
7847bcd0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
model_selection/test_models.py
model_selection/test_models.py
+6
-5
model_selection/test_results/testing_tuned_models.xlsx
model_selection/test_results/testing_tuned_models.xlsx
+0
-0
No files found.
model_selection/test_models.py
View file @
c04dcc50
...
...
@@ -219,8 +219,8 @@ if __name__ == "__main__":
'FN'
:
FN_scorer
,
'FP'
:
FP_scorer
,
'TP'
:
TP_scorer
,
'AUROC'
:
make_scorer
(
roc_auc_score
,
needs_threshold
=
True
),
# AUROC requires decision function or probability outputs
'AUPRC'
:
make_scorer
(
average_precision_score
,
needs_proba
=
True
)
# AUPRC requires probability outputs
'AUROC'
:
make_scorer
(
roc_auc_score
),
# AUROC requires decision function or probability outputs
'AUPRC'
:
make_scorer
(
average_precision_score
)
# AUPRC requires probability outputs
}
method_names
=
{
0
:
"ORIG"
,
...
...
@@ -235,9 +235,10 @@ if __name__ == "__main__":
scores_sheets
=
{}
# To store score dfs as sheets in the same excel file
for
i
,
group
in
enumerate
([
'pre'
,
'post'
]):
# Get test dataset based on group
X_test
=
data_dic
[
'X_test'
+
group
]
y_test
=
data_dic
[
'y_test'
+
group
]
X_test
=
data_dic
[
'X_test
_
'
+
group
]
y_test
=
data_dic
[
'y_test
_
'
+
group
]
for
j
,
method
in
enumerate
([
''
,
''
,
'over_'
,
'under_'
]):
print
(
f
"{group}-{method}"
)
# Get train dataset based on group and method
X_train
=
data_dic
[
'X_train_'
+
method
+
group
]
y_train
=
data_dic
[
'y_train_'
+
method
+
group
]
...
...
@@ -259,7 +260,7 @@ if __name__ == "__main__":
sheet_name
=
f
"{group}_{method_names[j]}"
scores_sheets
[
sheet_name
]
=
scores_df
# Write results to Excel file
with
pd
.
ExcelWriter
(
'./
model_selection/
test_results/testing_tuned_models.xlsx'
)
as
writer
:
with
pd
.
ExcelWriter
(
'./test_results/testing_tuned_models.xlsx'
)
as
writer
:
for
sheet_name
,
data
in
scores_sheets
.
items
():
data
.
to_excel
(
writer
,
sheet_name
=
sheet_name
)
# --------------------------------------------------------------------------------------------------------
...
...
model_selection/test_results/testing_tuned_models.xlsx
0 → 100644
View file @
c04dcc50
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment