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
bb7d8177
Commit
bb7d8177
authored
May 08, 2024
by
Joaquin Torres
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
waiting for details to launch, preparing for shap
parent
de229b37
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
models/hyperparam_tuning.py
models/hyperparam_tuning.py
+1
-3
models/shap.py
models/shap.py
+10
-0
No files found.
models/hyperparam_tuning.py
View file @
bb7d8177
...
...
@@ -152,9 +152,7 @@ if __name__ == "__main__":
# Store each df as a sheet in an excel file
sheets_dict
=
{}
for
i
,
group
in
enumerate
([
'pre'
,
'post'
]):
print
(
group
,
end
=
' '
)
for
j
,
method
in
enumerate
([
''
,
''
,
'over_'
,
'under_'
]):
print
(
method
,
end
=
' '
)
# Get dataset based on group and method
X
=
data_dic
[
'X_train_'
+
method
+
group
]
y
=
data_dic
[
'y_train_'
+
method
+
group
]
...
...
@@ -163,7 +161,7 @@ if __name__ == "__main__":
# Save results: params and best score for each of the mdodels of this method and group
hyperparam_df
=
pd
.
DataFrame
(
index
=
list
(
models
.
keys
()),
columns
=
[
'Parameters'
,
'Score'
])
for
model_name
,
model
in
models
.
items
():
print
(
model_name
+
"
\n\n
"
)
print
(
f
"{group}-{method}-{model_name}
\n\n
"
)
# Find optimal hyperparams for curr model
params
=
hyperparameters
[
model_name
]
search
=
RandomizedSearchCV
(
model
,
param_distributions
=
params
,
cv
=
cv
,
n_jobs
=
1
,
scoring
=
'precision'
)
...
...
models/shap.py
0 → 100644
View file @
bb7d8177
# Libraries
# --------------------------------------------------------------------------------------------------------
import
shap
import
numpy
as
np
# --------------------------------------------------------------------------------------------------------
# Load test data
X_test_pre
=
np
.
load
(
'../gen_train_data/data/output/pre/X_test_pre.npy'
,
allow_pickle
=
True
)
print
(
list
(
X_test_pre
.
columns
.
values
))
\ No newline at end of file
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