Skip to content

Commit 06b104d

Browse files
committed
Pushing the docs to dev/ for branch: master, commit d62d59f7800a722746523a215d1c61b434c25aa4
1 parent 6cce7db commit 06b104d

File tree

1,199 files changed

+3801
-3667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,199 files changed

+3801
-3667
lines changed
Binary file not shown.

dev/_downloads/7ee55c12f8d3eb1dd8d2005d9dd7b6f1/plot_release_highlights_0_22_0.py

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@
220220
# estimators using :func:`~utils.estimator_checks.check_estimator`. For
221221
# instance, the ``check_estimator(LinearSVC)`` passes.
222222
#
223-
# We now provide a ``pytest`` specific decorator which allows the ``pytest``
224-
# ro run all checks independently and report the checks that are failing.
223+
# We now provide a ``pytest`` specific decorator which allows ``pytest``
224+
# to run all checks independently and report the checks that are failing.
225225

226226
from sklearn.linear_model import LogisticRegression
227227
from sklearn.tree import DecisionTreeRegressor
@@ -231,3 +231,28 @@
231231
@parametrize_with_checks([LogisticRegression, DecisionTreeRegressor])
232232
def test_sklearn_compatible_estimator(estimator, check):
233233
check(estimator)
234+
235+
############################################################################
236+
# ROC AUC now supports multiclass classification
237+
# ----------------------------------------------
238+
# The :func:`roc_auc_score` function can also be used in multi-class
239+
# classification. Two averaging strategies are currently supported: the
240+
# one-vs-one algorithm computes the average of the pairwise ROC AUC scores, and
241+
# the one-vs-rest algorithm computes the average of the ROC AUC scores for each
242+
# class against all other classes. In both cases, the predicted labels are
243+
# provided in an array with values from 0 to ``n_classes``, and the scores
244+
# correspond to the probability estimates that a sample belongs to a particular
245+
# class. The OvO and OvR algorithms supports weighting uniformly
246+
# (``average='macro'``) and weighting by the prevalence
247+
# (``average='weighted'``).
248+
#
249+
# Read more in the :ref:`User Guide <roc_metrics>`.
250+
251+
252+
from sklearn.datasets import make_classification
253+
from sklearn.svm import SVC
254+
from sklearn.metrics import roc_auc_score
255+
256+
X, y = make_classification(n_classes=4, n_informative=16)
257+
clf = SVC(decision_function_shape='ovo', probability=True).fit(X, y)
258+
print(roc_auc_score(y, clf.predict_proba(X), multi_class='ovo'))

dev/_downloads/c101b602d0b3510ef47dd19d64a4a92b/plot_release_highlights_0_22_0.ipynb

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
"cell_type": "markdown",
167167
"metadata": {},
168168
"source": [
169-
"Checking scikit-learn compatibility of an estimator\n---------------------------------------------------\nDevelopers can check the compatibility of their scikit-learn compatible\nestimators using :func:`~utils.estimator_checks.check_estimator`. For\ninstance, the ``check_estimator(LinearSVC)`` passes.\n\nWe now provide a ``pytest`` specific decorator which allows the ``pytest``\nro run all checks independently and report the checks that are failing.\n\n"
169+
"Checking scikit-learn compatibility of an estimator\n---------------------------------------------------\nDevelopers can check the compatibility of their scikit-learn compatible\nestimators using :func:`~utils.estimator_checks.check_estimator`. For\ninstance, the ``check_estimator(LinearSVC)`` passes.\n\nWe now provide a ``pytest`` specific decorator which allows ``pytest``\nto run all checks independently and report the checks that are failing.\n\n"
170170
]
171171
},
172172
{
@@ -179,6 +179,24 @@
179179
"source": [
180180
"from sklearn.linear_model import LogisticRegression\nfrom sklearn.tree import DecisionTreeRegressor\nfrom sklearn.utils.estimator_checks import parametrize_with_checks\n\n\n@parametrize_with_checks([LogisticRegression, DecisionTreeRegressor])\ndef test_sklearn_compatible_estimator(estimator, check):\n check(estimator)"
181181
]
182+
},
183+
{
184+
"cell_type": "markdown",
185+
"metadata": {},
186+
"source": [
187+
"ROC AUC now supports multiclass classification\n----------------------------------------------\nThe :func:`roc_auc_score` function can also be used in multi-class\nclassification. Two averaging strategies are currently supported: the\none-vs-one algorithm computes the average of the pairwise ROC AUC scores, and\nthe one-vs-rest algorithm computes the average of the ROC AUC scores for each\nclass against all other classes. In both cases, the predicted labels are\nprovided in an array with values from 0 to ``n_classes``, and the scores\ncorrespond to the probability estimates that a sample belongs to a particular\nclass. The OvO and OvR algorithms supports weighting uniformly\n(``average='macro'``) and weighting by the prevalence\n(``average='weighted'``).\n\nRead more in the `User Guide <roc_metrics>`.\n\n"
188+
]
189+
},
190+
{
191+
"cell_type": "code",
192+
"execution_count": null,
193+
"metadata": {
194+
"collapsed": false
195+
},
196+
"outputs": [],
197+
"source": [
198+
"from sklearn.datasets import make_classification\nfrom sklearn.svm import SVC\nfrom sklearn.metrics import roc_auc_score\n\nX, y = make_classification(n_classes=4, n_informative=16)\nclf = SVC(decision_function_shape='ovo', probability=True).fit(X, y)\nprint(roc_auc_score(y, clf.predict_proba(X), multi_class='ovo'))"
199+
]
182200
}
183201
],
184202
"metadata": {
Binary file not shown.

dev/_downloads/scikit-learn-docs.pdf

52 KB
Binary file not shown.

dev/_images/iris.png

0 Bytes
82 Bytes
82 Bytes
619 Bytes
619 Bytes

0 commit comments

Comments
 (0)