Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scikit-learn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ian Johnson
scikit-learn
Commits
ef3da88b
Commit
ef3da88b
authored
11 years ago
by
Arnaud Joly
Committed by
Olivier Grisel
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
DOC put the narrative documentation of roc_curve and roc_auc_score in one place
parent
1f0815bd
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/modules/model_evaluation.rst
+18
-23
18 additions, 23 deletions
doc/modules/model_evaluation.rst
with
18 additions
and
23 deletions
doc/modules/model_evaluation.rst
+
18
−
23
View file @
ef3da88b
...
@@ -268,27 +268,6 @@ and with a list of labels format:
...
@@ -268,27 +268,6 @@ and with a list of labels format:
for an example of accuracy score usage using permutations of
for an example of accuracy score usage using permutations of
the dataset.
the dataset.
Area under the ROC curve
.........................
The :func:`roc_auc_score` function computes the area under the receiver
operating characteristic (ROC) curve.
This function requires the true binary value and the target scores, which can
either be probability estimates of the positive class, confidence values, or
binary decisions.
>>> import numpy as np
>>> from sklearn.metrics import roc_auc_score
>>> y_true = np.array([0, 0, 1, 1])
>>> y_scores = np.array([0.1, 0.4, 0.35, 0.8])
>>> roc_auc_score(y_true, y_scores)
0.75
For more information see the
`Wikipedia article on AUC
<http://en.wikipedia.org/wiki/Receiver_operating_characteristic#Area_under_curve>`_
and the :ref:`roc_metrics` section.
.. _average_precision_metrics:
.. _average_precision_metrics:
...
@@ -713,7 +692,7 @@ with a svm classifier::
...
@@ -713,7 +692,7 @@ with a svm classifier::
Log loss
Log loss
--------
........
The log loss, also called logistic regression loss or cross-entropy loss,
The log loss, also called logistic regression loss or cross-entropy loss,
is a loss function defined on probability estimates.
is a loss function defined on probability estimates.
It is commonly used in (multinomial) logistic regression and neural networks,
It is commonly used in (multinomial) logistic regression and neural networks,
...
@@ -795,7 +774,7 @@ function:
...
@@ -795,7 +774,7 @@ function:
.. _roc_metrics:
.. _roc_metrics:
Receiver operating characteristic (ROC)
Receiver operating characteristic (ROC)
.......................................
.
.......................................
The function :func:`roc_curve` computes the `receiver operating characteristic
The function :func:`roc_curve` computes the `receiver operating characteristic
curve, or ROC curve (quoting
curve, or ROC curve (quoting
...
@@ -809,6 +788,9 @@ Wikipedia) <http://en.wikipedia.org/wiki/Receiver_operating_characteristic>`_:
...
@@ -809,6 +788,9 @@ Wikipedia) <http://en.wikipedia.org/wiki/Receiver_operating_characteristic>`_:
positive rate), at various threshold settings. TPR is also known as
positive rate), at various threshold settings. TPR is also known as
sensitivity, and FPR is one minus the specificity or true negative rate."
sensitivity, and FPR is one minus the specificity or true negative rate."
This function requires the true binary
value and the target scores, which can either be probability estimates of the
positive class, confidence values, or binary decisions.
Here a small example of how to use the :func:`roc_curve` function::
Here a small example of how to use the :func:`roc_curve` function::
>>> import numpy as np
>>> import numpy as np
...
@@ -823,6 +805,19 @@ Here a small example of how to use the :func:`roc_curve` function::
...
@@ -823,6 +805,19 @@ Here a small example of how to use the :func:`roc_curve` function::
>>> thresholds
>>> thresholds
array([ 0.8 , 0.4 , 0.35, 0.1 ])
array([ 0.8 , 0.4 , 0.35, 0.1 ])
The :func:`roc_auc_score` function computes the area under the receiver
operating characteristic (ROC) curve, which is also denoted by
AUC or AUROC. By computing the
area under the roc curve, the curve information is summarized in one number.
For more information see the `Wikipedia article on AUC
<http://en.wikipedia.org/wiki/Receiver_operating_characteristic#Area_under_curve>`_.
>>> import numpy as np
>>> from sklearn.metrics import roc_auc_score
>>> y_true = np.array([0, 0, 1, 1])
>>> y_scores = np.array([0.1, 0.4, 0.35, 0.8])
>>> roc_auc_score(y_true, y_scores)
0.75
The following figure shows an example of such ROC curve.
The following figure shows an example of such ROC curve.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment