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
20a35749
Commit
20a35749
authored
May 23, 2024
by
Joaquin Torres
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Thinking about merging scroings and plots
parent
18034aa8
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81726 additions
and
15353 deletions
+81726
-15353
model_selection/cv_metric_gen.py
model_selection/cv_metric_gen.py
+54
-55
model_selection/output_cv_metrics/curves/pre_ORIG.svg
model_selection/output_cv_metrics/curves/pre_ORIG.svg
+81672
-15298
No files found.
model_selection/cv_metric_gen.py
View file @
20a35749
...
@@ -175,8 +175,8 @@ if __name__ == "__main__":
...
@@ -175,8 +175,8 @@ if __name__ == "__main__":
# Metric generation through cv for tuned models3
# Metric generation through cv for tuned models3
# --------------------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------------------
scores_sheets
=
{}
# To store score dfs as sheets in the same excel file
scores_sheets
=
{}
# To store score dfs as sheets in the same excel file
for
i
,
group
in
enumerate
([
'pre'
]):
# 'post'
for
i
,
group
in
enumerate
([
'pre'
,
'post'
]):
# 'post'
for
j
,
method
in
enumerate
([
''
]):
# '', 'over_', 'under_'
for
j
,
method
in
enumerate
([
''
,
'over_'
,
'under_'
]):
# Get train dataset based on group and method
# Get train dataset based on group and method
X_train
=
data_dic
[
'X_train_'
+
method
+
group
]
X_train
=
data_dic
[
'X_train_'
+
method
+
group
]
y_train
=
data_dic
[
'y_train_'
+
method
+
group
]
y_train
=
data_dic
[
'y_train_'
+
method
+
group
]
...
@@ -190,7 +190,6 @@ if __name__ == "__main__":
...
@@ -190,7 +190,6 @@ if __name__ == "__main__":
axes
=
[
axes
]
axes
=
[
axes
]
# Metric generation for each model
# Metric generation for each model
for
model_idx
,
(
model_name
,
model
)
in
enumerate
(
models
.
items
()):
for
model_idx
,
(
model_name
,
model
)
in
enumerate
(
models
.
items
()):
if
model_name
==
'XGB'
:
print
(
f
"{group}-{method_names[j]}-{model_name}"
)
print
(
f
"{group}-{method_names[j]}-{model_name}"
)
# Retrieve cv scores for our metrics of interest
# Retrieve cv scores for our metrics of interest
scores
=
cross_validate
(
model
,
X_train
,
y_train
,
scoring
=
scorings
,
cv
=
cv
,
return_train_score
=
True
,
n_jobs
=
10
)
scores
=
cross_validate
(
model
,
X_train
,
y_train
,
scoring
=
scorings
,
cv
=
cv
,
return_train_score
=
True
,
n_jobs
=
10
)
...
...
model_selection/output_cv_metrics/curves/pre_ORIG.svg
View file @
20a35749
This diff is collapsed.
Click to expand it.
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