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
Imanol Perez
Physionet-ICU-Challenge
Commits
0ca5cac2
Commit
0ca5cac2
authored
May 11, 2018
by
Imanol Perez
Browse files
Add threshold to predictions
parent
2d58eedd
Changes
1
Hide whitespace changes
Inline
Side-by-side
performance.py
View file @
0ca5cac2
...
...
@@ -8,11 +8,10 @@ def evaluate(classifier, features, Y):
print
(
"Evaluating performance..."
)
#predictions = classifier.predict_proba(features)[:, 1]
#roc = roc_auc_score(Y, predictions)
#print("ROC of predictions: %s"%roc)
predictions
=
classifier
.
predict
(
features
)
THRESHOLD
=
.
3
predictions_proba
=
classifier
.
predict_proba
(
features
)[:,
1
]
predictions
=
[
1.
if
pred
>
THRESHOLD
else
0.
for
pred
in
predictions_proba
]
cm
=
confusion_matrix
(
Y
,
predictions
)
Se
=
cm
[
1
,
1
]
/
float
(
cm
[
1
,
1
]
+
cm
[
1
,
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