Skip to content

Commit 33e1b2c

Browse files
committed
[ci skip] MTN Made the distinction between predictor and transformer clearer (INRIA#856) aa0fdfb
1 parent 732cd82 commit 33e1b2c

File tree

194 files changed

+1253
-375
lines changed

Some content is hidden

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

194 files changed

+1253
-375
lines changed
44.7 KB
Loading

_sources/python_scripts/02_numerical_pipeline_introduction.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,18 @@
101101
# ![Predictor fit diagram](../figures/api_diagram-predictor.fit.svg)
102102
#
103103
# In scikit-learn an object that has a `fit` method is called an **estimator**.
104+
# If the estimator additionally has :
105+
# - a `predict` method, it is called a **predictor**. Examples of predictors
106+
# are classifiers or regressors.
107+
# - a `transform` method, it is called a **transformer**. Examples of
108+
# transformers are scalers or encoders. We will see more about transformers in
109+
# the next notebook.
110+
#
104111
# The method `fit` is composed of two elements: (i) a **learning algorithm** and
105112
# (ii) some **model states**. The learning algorithm takes the training data and
106113
# training target as input and sets the model states. These model states are
107-
# later used to either predict (for classifiers and regressors) or transform
108-
# data (for transformers).
114+
# later used to either predict or transform data as explained above. See the
115+
# glossary for more detailed definitions.
109116
#
110117
# Both the learning algorithm and the type of model states are specific to each
111118
# type of model.
@@ -124,8 +131,7 @@
124131
target_predicted = model.predict(data)
125132

126133
# %% [markdown]
127-
# An estimator (an object with a `fit` method) with a `predict` method is called
128-
# a **predictor**. We can illustrate the prediction mechanism as follows:
134+
# We can illustrate the prediction mechanism as follows:
129135
#
130136
# ![Predictor predict diagram](../figures/api_diagram-predictor.predict.svg)
131137
#

_sources/python_scripts/02_numerical_pipeline_scaling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
# We show how to apply such normalization using a scikit-learn transformer
8989
# called `StandardScaler`. This transformer shifts and scales each feature
9090
# individually so that they all have a 0-mean and a unit standard deviation.
91+
# We recall that transformers are estimators that have a `transform` method.
9192
#
9293
# We now investigate different steps used in scikit-learn to achieve such a
9394
# transformation of the data.

_sources/python_scripts/parameter_tuning_grid_search.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
# that, here we only explore the combination learning-rate and the maximum
137137
# number of nodes for a total of 4 x 3 = 12 combinations.
138138

139+
# %%
139140
# %%time
140141
from sklearn.model_selection import GridSearchCV
141142

appendix/acknowledgement.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
<script>const THEBE_JS_URL = "https://unpkg.com/thebe@0.8.2/lib/index.js"; const thebe_selector = ".thebe,.cell"; const thebe_selector_input = "pre"; const thebe_selector_output = ".output, .cell_output"</script>
6262
<script>DOCUMENTATION_OPTIONS.pagename = 'appendix/acknowledgement';</script>
6363
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
64-
<script src="../_static/matomo.js?v=8af330ab"></script>
6564
<script src="../_static/sklearn_mooc.js?v=cdec65c7"></script>
65+
<script src="../_static/matomo.js?v=8af330ab"></script>
6666
<link rel="icon" href="../_static/favicon.ico"/>
6767
<link rel="index" title="Index" href="../genindex.html" />
6868
<link rel="search" title="Search" href="../search.html" />

appendix/datasets_intro.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
<script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
6464
<script>DOCUMENTATION_OPTIONS.pagename = 'appendix/datasets_intro';</script>
6565
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
66-
<script src="../_static/matomo.js?v=8af330ab"></script>
6766
<script src="../_static/sklearn_mooc.js?v=cdec65c7"></script>
67+
<script src="../_static/matomo.js?v=8af330ab"></script>
6868
<link rel="icon" href="../_static/favicon.ico"/>
6969
<link rel="index" title="Index" href="../genindex.html" />
7070
<link rel="search" title="Search" href="../search.html" />

appendix/glossary.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
<script>const THEBE_JS_URL = "https://unpkg.com/thebe@0.8.2/lib/index.js"; const thebe_selector = ".thebe,.cell"; const thebe_selector_input = "pre"; const thebe_selector_output = ".output, .cell_output"</script>
6262
<script>DOCUMENTATION_OPTIONS.pagename = 'appendix/glossary';</script>
6363
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
64-
<script src="../_static/matomo.js?v=8af330ab"></script>
6564
<script src="../_static/sklearn_mooc.js?v=cdec65c7"></script>
65+
<script src="../_static/matomo.js?v=8af330ab"></script>
6666
<link rel="icon" href="../_static/favicon.ico"/>
6767
<link rel="index" title="Index" href="../genindex.html" />
6868
<link rel="search" title="Search" href="../search.html" />

appendix/notebook_timings.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
<script>const THEBE_JS_URL = "https://unpkg.com/thebe@0.8.2/lib/index.js"; const thebe_selector = ".thebe,.cell"; const thebe_selector_input = "pre"; const thebe_selector_output = ".output, .cell_output"</script>
6262
<script>DOCUMENTATION_OPTIONS.pagename = 'appendix/notebook_timings';</script>
6363
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
64-
<script src="../_static/matomo.js?v=8af330ab"></script>
6564
<script src="../_static/sklearn_mooc.js?v=cdec65c7"></script>
65+
<script src="../_static/matomo.js?v=8af330ab"></script>
6666
<link rel="icon" href="../_static/favicon.ico"/>
6767
<link rel="index" title="Index" href="../genindex.html" />
6868
<link rel="search" title="Search" href="../search.html" />
@@ -1139,10 +1139,10 @@ <h1>Notebook timings<a class="headerlink" href="#notebook-timings" title="Link t
11391139
<td><p></p></td>
11401140
</tr>
11411141
<tr class="row-odd"><td><p><a class="xref doc reference internal" href="../python_scripts/parameter_tuning_grid_search.html"><span class="doc">python_scripts/parameter_tuning_grid_search</span></a></p></td>
1142-
<td><p>2025-08-07 17:33</p></td>
1142+
<td><p>2025-08-13 11:33</p></td>
11431143
<td><p>cache</p></td>
1144-
<td><p>2.2</p></td>
1145-
<td><p><abbr title="CellExecutionError"></abbr></p></td>
1144+
<td><p>11.8</p></td>
1145+
<td><p></p></td>
11461146
</tr>
11471147
<tr class="row-even"><td><p><a class="xref doc reference internal" href="../python_scripts/parameter_tuning_manual.html"><span class="doc">python_scripts/parameter_tuning_manual</span></a></p></td>
11481148
<td><p>2025-08-07 11:47</p></td>

appendix/toc_redirect.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
<script>const THEBE_JS_URL = "https://unpkg.com/thebe@0.8.2/lib/index.js"; const thebe_selector = ".thebe,.cell"; const thebe_selector_input = "pre"; const thebe_selector_output = ".output, .cell_output"</script>
6262
<script>DOCUMENTATION_OPTIONS.pagename = 'appendix/toc_redirect';</script>
6363
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
64-
<script src="../_static/matomo.js?v=8af330ab"></script>
6564
<script src="../_static/sklearn_mooc.js?v=cdec65c7"></script>
65+
<script src="../_static/matomo.js?v=8af330ab"></script>
6666
<link rel="icon" href="../_static/favicon.ico"/>
6767
<link rel="index" title="Index" href="../genindex.html" />
6868
<link rel="search" title="Search" href="../search.html" />

concluding_remarks.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
<script>const THEBE_JS_URL = "https://unpkg.com/thebe@0.8.2/lib/index.js"; const thebe_selector = ".thebe,.cell"; const thebe_selector_input = "pre"; const thebe_selector_output = ".output, .cell_output"</script>
6262
<script>DOCUMENTATION_OPTIONS.pagename = 'concluding_remarks';</script>
6363
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
64-
<script src="_static/matomo.js?v=8af330ab"></script>
6564
<script src="_static/sklearn_mooc.js?v=cdec65c7"></script>
65+
<script src="_static/matomo.js?v=8af330ab"></script>
6666
<link rel="icon" href="_static/favicon.ico"/>
6767
<link rel="index" title="Index" href="genindex.html" />
6868
<link rel="search" title="Search" href="search.html" />

0 commit comments

Comments
 (0)