Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Paul Primus
dcase2020_task2
Commits
fe945d46
Commit
fe945d46
authored
Jun 10, 2020
by
Paul Primus
Browse files
fixed auroc bug
parent
d561f7d1
Changes
1
Show whitespace changes
Inline
Side-by-side
dcase2020_task2/utils/logger.py
View file @
fe945d46
...
...
@@ -217,10 +217,14 @@ class Logger:
@
staticmethod
def
__rauc_from_score__
(
scores_mean
,
scores_max
,
ground_truth
,
machine_types
,
machine_ids
,
machine_type
,
id
,
max_fpr
=
0.1
):
ground_truth_
=
ground_truth
[
np
.
logical_and
(
machine_types
==
machine_type
,
machine_ids
==
id
)]
scores_mean_
=
scores_mean
[
np
.
logical_and
(
machine_types
==
machine_type
,
machine_ids
==
id
)]
scores_max_
=
scores_max
[
np
.
logical_and
(
machine_types
==
machine_type
,
machine_ids
==
id
)]
if
all
(
ground_truth
[
0
]
==
np
.
array
(
ground_truth
)):
return
0
,
0
,
0
,
0
return
float
(
metrics
.
roc_auc_score
(
ground_truth_
,
scores_mean_
)),
\
float
(
metrics
.
roc_auc_score
(
ground_truth_
,
scores_mean_
,
max_fpr
=
max_fpr
)),
\
float
(
metrics
.
roc_auc_score
(
ground_truth_
,
scores_max_
)),
\
...
...
Write
Preview
Supports
Markdown
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