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
8e0361fd
Commit
8e0361fd
authored
May 04, 2018
by
Imanol Perez
Browse files
Upload project
parent
b4b1bc14
Changes
1
Hide whitespace changes
Inline
Side-by-side
performance.py
View file @
8e0361fd
...
...
@@ -8,15 +8,15 @@ 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_proba(features)[:, 1]
#
roc = roc_auc_score(Y, predictions)
#
print("ROC of predictions: %s"%roc)
#
predictions = classifier.predict(features)
#
cm = confusion_matrix(Y, predictions)
predictions
=
classifier
.
predict
(
features
)
cm
=
confusion_matrix
(
Y
,
predictions
)
#
Se = cm[1, 1] / float(cm[1,
0
] + cm[1, 0])
#
P = cm[1, 1] / float(cm[1,
0
] + cm[0, 1])
#
score = min(Se, P)
Se
=
cm
[
1
,
1
]
/
float
(
cm
[
1
,
1
]
+
cm
[
1
,
0
])
P
=
cm
[
1
,
1
]
/
float
(
cm
[
1
,
1
]
+
cm
[
0
,
1
])
score
=
min
(
Se
,
P
)
#
print("Score of predictions: %s"%score)
print
(
"Score of predictions: %s"
%
score
)
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