Skip to content

Commit de53b81

Browse files
committed
Rebuild dev docs at master=4bcfedb
1 parent 8e30e38 commit de53b81

File tree

245 files changed

+1442
-1392
lines changed

Some content is hidden

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

245 files changed

+1442
-1392
lines changed

dev/_downloads/plot_roc.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from sklearn.cross_validation import train_test_split
4545
from sklearn.preprocessing import label_binarize
4646
from sklearn.multiclass import OneVsRestClassifier
47+
from scipy import interp
4748

4849
# Import some data to play with
4950
iris = datasets.load_iris()
@@ -99,10 +100,23 @@
99100
# Plot ROC curves for the multiclass problem
100101

101102
# Compute macro-average ROC curve and ROC area
102-
fpr["macro"] = np.mean([fpr[i] for i in range(n_classes)], axis=0)
103-
tpr["macro"] = np.mean([tpr[i] for i in range(n_classes)], axis=0)
103+
104+
# First aggregate all false positive rates
105+
all_fpr = np.unique(np.concatenate([fpr[i] for i in range(n_classes)]))
106+
107+
# Then interpolate all ROC curves at this points
108+
mean_tpr = np.zeros_like(all_fpr)
109+
for i in range(n_classes):
110+
mean_tpr += interp(all_fpr, fpr[i], tpr[i])
111+
112+
# Finally average it and compute AUC
113+
mean_tpr /= n_classes
114+
115+
fpr["macro"] = all_fpr
116+
tpr["macro"] = mean_tpr
104117
roc_auc["macro"] = auc(fpr["macro"], tpr["macro"])
105118

119+
# Plot all ROC curves
106120
plt.figure()
107121
plt.plot(fpr["micro"], tpr["micro"],
108122
label='micro-average ROC curve (area = {0:0.2f})'

dev/_images/plot_roc.png

18.8 KB
Loading

dev/_images/plot_roc1.png

18.8 KB
Loading

dev/_images/plot_roc_001.png

36.2 KB
Loading

dev/_images/plot_roc_0011.png

36.2 KB
Loading

dev/_images/plot_roc_002.png

77.8 KB
Loading

dev/_images/plot_roc_0021.png

77.8 KB
Loading

dev/_sources/auto_examples/index.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4408,14 +4408,14 @@ Examples concerning model selection, mostly contained in the
44084408

44094409
.. raw:: html
44104410

4411-
<div class="thumbnailContainer" tooltip="Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality...">
4411+
<div class="thumbnailContainer" tooltip="On the left side the learning curve of a naive Bayes classifier is shown for the digits dataset...">
44124412

44134413
.. only:: html
44144414

4415-
.. figure:: model_selection/images/thumb/plot_roc.png
4416-
:target: ./model_selection/plot_roc.html
4415+
.. figure:: model_selection/images/thumb/plot_learning_curve.png
4416+
:target: ./model_selection/plot_learning_curve.html
44174417

4418-
:ref:`example_model_selection_plot_roc.py`
4418+
:ref:`example_model_selection_plot_learning_curve.py`
44194419

44204420

44214421
.. raw:: html
@@ -4427,20 +4427,20 @@ Examples concerning model selection, mostly contained in the
44274427
.. toctree::
44284428
:hidden:
44294429

4430-
model_selection/plot_roc
4430+
model_selection/plot_learning_curve
44314431

44324432

44334433

44344434
.. raw:: html
44354435

4436-
<div class="thumbnailContainer" tooltip="On the left side the learning curve of a naive Bayes classifier is shown for the digits dataset...">
4436+
<div class="thumbnailContainer" tooltip="Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality...">
44374437

44384438
.. only:: html
44394439

4440-
.. figure:: model_selection/images/thumb/plot_learning_curve.png
4441-
:target: ./model_selection/plot_learning_curve.html
4440+
.. figure:: model_selection/images/thumb/plot_roc.png
4441+
:target: ./model_selection/plot_roc.html
44424442

4443-
:ref:`example_model_selection_plot_learning_curve.py`
4443+
:ref:`example_model_selection_plot_roc.py`
44444444

44454445

44464446
.. raw:: html
@@ -4452,7 +4452,7 @@ Examples concerning model selection, mostly contained in the
44524452
.. toctree::
44534453
:hidden:
44544454

4455-
model_selection/plot_learning_curve
4455+
model_selection/plot_roc
44564456

44574457

44584458
.. raw:: html

dev/_sources/auto_examples/model_selection/plot_roc.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ label.
4444
.. rst-class:: horizontal
4545

4646

47+
*
48+
49+
.. image:: images/plot_roc_001.png
50+
:scale: 47
51+
52+
*
53+
54+
.. image:: images/plot_roc_002.png
55+
:scale: 47
56+
4757

4858

4959

@@ -52,6 +62,6 @@ label.
5262
.. literalinclude:: plot_roc.py
5363
:lines: 38-
5464

55-
**Total running time of the example:** 0.00 seconds
56-
( 0 minutes 0.00 seconds)
65+
**Total running time of the example:** 0.36 seconds
66+
( 0 minutes 0.36 seconds)
5767

dev/_sources/related_projects.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ and tasks.
8787
- `mlxtend <https://github.com/rasbt/mlxtend>`_ Includes a number of additional
8888
estimators as well as model visualization utilities.
8989

90+
- `kmodes <https://github.com/nicodv/kmodes>`_ k-modes clustering algorithm for categorical data, and
91+
several of its variations.
92+
9093
Statistical learning with Python
9194
--------------------------------
9295
Other packages useful for data analysis and machine learning.

0 commit comments

Comments
 (0)