Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
MPBA
INF
Commits
0097a83b
Commit
0097a83b
authored
Mar 02, 2020
by
Alessia Marcolini
Browse files
Fix reading of MCC test file
parent
8d91e54b
Changes
1
Hide whitespace changes
Inline
Side-by-side
postprocessing/compute_all_metrics.py
View file @
0097a83b
...
...
@@ -111,6 +111,9 @@ for k in range_combinations:
file_metrics
=
os
.
path
.
join
(
PATH
,
f
'
{
MODE
}
/
{
layers_concat
}
_tr_
{
MODEL
}
_rankList_allmetrics.txt'
)
file_MCC_test
=
os
.
path
.
join
(
PATH
,
MODE
,
f
'
{
layers_concat
}
_tr_MCC_scores.txt'
)
elif
MODE
==
'rSNFi'
:
file_log
=
os
.
path
.
join
(
...
...
@@ -119,6 +122,9 @@ for k in range_combinations:
file_metrics
=
os
.
path
.
join
(
PATH
,
f
'
{
MODE
}
/
{
layers_concat
}
_ts_
{
MODEL
}
_KBest_allmetrics.txt'
)
file_MCC_test
=
os
.
path
.
join
(
PATH
,
MODE
,
f
'
{
layers_concat
}
_ts_MCC_scores.txt'
)
else
:
file_log
=
os
.
path
.
join
(
PATH
,
f
'
{
MODE
}
/
{
layers_concat
}
_tr_
{
MODEL
}
_KBest.log'
...
...
@@ -126,6 +132,9 @@ for k in range_combinations:
file_metrics
=
os
.
path
.
join
(
PATH
,
f
'
{
MODE
}
/
{
layers_concat
}
_tr_
{
MODEL
}
_KBest_allmetrics.txt'
)
file_MCC_test
=
os
.
path
.
join
(
PATH
,
MODE
,
f
'
{
layers_concat
}
_tr_MCC_scores.txt'
)
with
open
(
file_log
)
as
f
:
log_content
=
f
.
readlines
()
...
...
@@ -141,9 +150,12 @@ for k in range_combinations:
best_feat
=
int
(
best_feat_line
.
split
(
' = '
)[
1
][:
-
1
])
best_feat_steps
.
append
(
best_feat
)
mcc_test
=
float
(
mcc_test_line
.
split
(
' = '
)[
1
][:
-
1
])
with
open
(
file_MCC_test
,
'r'
)
as
f
:
mcc_test
=
float
(
f
.
readlines
()[
1
].
split
(
'
\t
'
)[
1
])
print
(
mcc_test
)
all_test_mccs
.
append
(
mcc_test
)
# %%
all_metrics
=
pd
.
read_csv
(
file_metrics
,
sep
=
'
\t
'
)
best_idxs
=
np
.
where
(
all_metrics
[
"nf"
]
==
best_feat
)[
0
]
...
...
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