Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
antifragility
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ana Pamela Osuna Vargas
antifragility
Commits
5945ed43
Commit
5945ed43
authored
Dec 08, 2019
by
Pamela Osuna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
final kfold added
parent
db5a9e46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
main.py
+13
-2
No files found.
main.py
View file @
5945ed43
...
@@ -30,10 +30,21 @@ max_params = combinations[0]
...
@@ -30,10 +30,21 @@ max_params = combinations[0]
max_avg_auc
=
0
max_avg_auc
=
0
for
params
in
combinations
:
for
params
in
combinations
:
avg_acc
,
avg_auc
=
cnn
.
run_nn
(
input_
,
output_
,
n_experiences
,
params
)
avg_acc
,
avg_auc
,
X_train_kfold
,
X_test_kfold
,
y_train_kfold
,
y_test_kfold
=
cnn
.
run_nn
(
input_
,
output_
,
n_experiences
,
params
)
if
avg_auc
>
max_avg_auc
:
if
avg_auc
>
max_avg_auc
:
max_avg_auc
=
avg_auc
max_avg_auc
=
avg_auc
max_params
=
params
max_params
=
params
X_train_kfold_opt
=
X_train_kfold
X_test_kfold_opt
=
X_test_kfold
y_train_kfold_opt
=
y_train_kfold
y_test_kfold_opt
=
y_test_kfold
# once we have chosen the optimal parameters we can do the normal kfold
## to do: final kfold with optimal parameters, code to execute in paralel, make sure it's the same random shuffle ...
#note: the test data remains unbalanced
acc
,
auc
=
cnn
.
run_kfold
(
X_train_opt
,
X_test_kfold_opt
,
y_train_kfold_opt
,
y_test_kfold_opt
,
max_params
)
## TO DO: create confusion matrix, etc...
## TO DO: code that allows to execute in parallel, make sure it's the same random shuffle ...
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