Skip to content

Commit 3d30c18

Browse files
author
Vincent Blot
committed
FIX : updat cifar10.rst file for class and typo
1 parent 36107a6 commit 3d30c18

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

doc/Cifar10.rst

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
Estimating prediction sets on the Cifar10 dataset
23
=================================================
34

@@ -9,15 +10,15 @@ What is done in this tutorial ?
910

1011
..
1112
12-
- Use :class:``mapie.classification.MapieClassifier`` to compare the
13+
- Use :class:`mapie.classification.MapieClassifier` to compare the
1314
prediction sets estimated by several conformal methods on the
1415
Cifar10 dataset.
1516

1617
- Train a small CNN to predict the image class
1718

1819
..
1920
20-
- Create a custom class ``TensorflowToMapie`` to resolve adherence
21+
- Create a custom class `TensorflowToMapie` to resolve adherence
2122
problems between Tensorflow and Mapie
2223

2324
Tutorial preparation
@@ -63,15 +64,15 @@ Tutorial preparation
6364
1. Data loading
6465
---------------
6566

66-
The Cifar10 dataset is downloaded from the ``Tensorflow Datasets``
67+
The Cifar10 dataset is downloaded from the `Tensorflow Datasets`
6768
library. The training set is then splitted into a training, validation
6869
and a calibration set which will be used as follow:
6970

7071
- **Training set**: used to train our neural network.
7172
- **Validation set**: used to check that our model is not
7273
overfitting.
7374
- **Calibration set**: used to calibrate the conformal scores in
74-
:class:``mapie.classification.MapieClassifier``
75+
:class:`mapie.classification.MapieClassifier`
7576

7677
.. code-block:: python
7778
@@ -318,11 +319,11 @@ a perfect classifier.
318319
model.compile(loss=loss, optimizer=optimizer, metrics=metrics)
319320
return model
320321
321-
Training the algorithm with a custom class called ``TensorflowToMapie``
322+
Training the algorithm with a custom class called `TensorflowToMapie`
322323
-----------------------------------------------------------------------
323324

324-
As MAPIE asked that the model has a ``fit``, ``predict_proba``,
325-
``predict`` class attributes and that the information about if whether
325+
As MAPIE asked that the model has a `fit`, `predict_proba`,
326+
`predict` class attributes and that the information about if whether
326327
or not the model is fitted.
327328

328329
.. code-block:: python
@@ -495,7 +496,7 @@ or not the model is fitted.
495496
------------------------------------
496497

497498
We will now estimate the prediction sets with the five conformal methods
498-
implemented in :class:``mapie.classification.MapieClassifier`` for a
499+
implemented in :class:`mapie.classification.MapieClassifier` for a
499500
range of confidence levels between 0 and 1.
500501

501502
.. code-block:: python
@@ -1040,7 +1041,7 @@ smaller than that of the naive method.
10401041
10411042
.. code-block:: python
10421043
1043-
def plot_confusion_matix(method: str, y_ps: Dict[str, np.ndarray], label_names: List) -> None:
1044+
def plot_confusion_matrix(method: str, y_ps: Dict[str, np.ndarray], label_names: List) -> None:
10441045
"""
10451046
Plot the confusion matrix for a specific method.
10461047
@@ -1075,7 +1076,7 @@ smaller than that of the naive method.
10751076
10761077
.. code-block:: python
10771078
1078-
plot_confusion_matix("cumulated_score", y_ps_90, label_names)
1079+
plot_confusion_matrix("cumulated_score", y_ps_90, label_names)
10791080
10801081
10811082
@@ -1091,7 +1092,7 @@ label is quite often within the prediction set while the deer is not
10911092

10921093
.. code-block:: python
10931094
1094-
plot_confusion_matix("naive", y_ps_90, label_names)
1095+
plot_confusion_matrix("naive", y_ps_90, label_names)
10951096
10961097
10971098
@@ -1100,7 +1101,7 @@ label is quite often within the prediction set while the deer is not
11001101

11011102
.. code-block:: python
11021103
1103-
plot_confusion_matix("score", y_ps_90, label_names)
1104+
plot_confusion_matrix("score", y_ps_90, label_names)
11041105
11051106
11061107

notebooks/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ convert2rst:
77
gsed -i -e'/UserWarning/d' $(dir)/$(file).rst
88
gsed -i -e'/WARNING:tensorflow/d' $(dir)/$(file).rst
99
gsed -i -e's/.. code:: ipython3/.. code-block:: python/g' $(dir)/$(file).rst
10+
gsed -i -e's/``/`/g' $(dir)/$(file).rst
1011
cp $(dir)/$(file).rst ../doc/$(file).rst
1112
cp -r $(dir)/$(file)_files ../doc/
1213
rm -rf $(dir)/.ipynb_checkpoints

notebooks/classification/Cifar10.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@
13241324
"metadata": {},
13251325
"outputs": [],
13261326
"source": [
1327-
"def plot_confusion_matix(method: str, y_ps: Dict[str, np.ndarray], label_names: List) -> None:\n",
1327+
"def plot_confusion_matrix(method: str, y_ps: Dict[str, np.ndarray], label_names: List) -> None:\n",
13281328
" \"\"\"\n",
13291329
" Plot the confusion matrix for a specific method.\n",
13301330
" \n",
@@ -1377,7 +1377,7 @@
13771377
}
13781378
],
13791379
"source": [
1380-
"plot_confusion_matix(\"cumulated_score\", y_ps_90, label_names)"
1380+
"plot_confusion_matrix(\"cumulated_score\", y_ps_90, label_names)"
13811381
]
13821382
},
13831383
{
@@ -1406,7 +1406,7 @@
14061406
}
14071407
],
14081408
"source": [
1409-
"plot_confusion_matix(\"naive\", y_ps_90, label_names)"
1409+
"plot_confusion_matrix(\"naive\", y_ps_90, label_names)"
14101410
]
14111411
},
14121412
{
@@ -1428,7 +1428,7 @@
14281428
}
14291429
],
14301430
"source": [
1431-
"plot_confusion_matix(\"score\", y_ps_90, label_names)"
1431+
"plot_confusion_matrix(\"score\", y_ps_90, label_names)"
14321432
]
14331433
}
14341434
],

0 commit comments

Comments
 (0)