Skip to content

Commit

Permalink
[ci skip] FIX correction for some typos (#779)
Browse files Browse the repository at this point in the history
Co-authored-by: ArturoAmorQ <[email protected]> 00379f8
  • Loading branch information
glemaitre committed May 17, 2024
1 parent 0a416f8 commit bb625e6
Show file tree
Hide file tree
Showing 99 changed files with 792 additions and 780 deletions.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
2 changes: 1 addition & 1 deletion _sources/python_scripts/cross_validation_ex_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# exercise.
#
# Also, this classifier can become more flexible/expressive by using a so-called
# kernel that makes the model become non-linear. Again, no requirement regarding
# kernel that makes the model become non-linear. Again, no undestanding regarding
# the mathematics is required to accomplish this exercise.
#
# We will use an RBF kernel where a parameter `gamma` allows to tune the
Expand Down
2 changes: 1 addition & 1 deletion _sources/python_scripts/cross_validation_sol_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# exercise.
#
# Also, this classifier can become more flexible/expressive by using a so-called
# kernel that makes the model become non-linear. Again, no requirement regarding
# kernel that makes the model become non-linear. Again, no understanding regarding
# the mathematics is required to accomplish this exercise.
#
# We will use an RBF kernel where a parameter `gamma` allows to tune the
Expand Down
3 changes: 2 additions & 1 deletion _sources/python_scripts/linear_regression_non_linear_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

# %% [markdown]
# ```{tip}
# `np.random.RandomState` allows to create a random number generator which can
# `np.random.RandomState` allows creating a random number generator which can
# be later used to get deterministic results.
# ```
#
Expand Down Expand Up @@ -172,6 +172,7 @@ def fit_score_plot_regression(model, title=None):
# of the absolute values of the differences between the features generated by
# both methods and checking that it is close to zero:

# %%
np.abs(polynomial_expansion.fit_transform(data) - data_expanded).max()

# %% [markdown]
Expand Down
364 changes: 182 additions & 182 deletions appendix/notebook_timings.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions python_scripts/02_numerical_pipeline_cross_validation.html
Original file line number Diff line number Diff line change
Expand Up @@ -799,12 +799,12 @@ <h2>The need for cross-validation<a class="headerlink" href="#the-need-for-cross
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>CPU times: user 461 ms, sys: 273 ms, total: 734 ms
Wall time: 412 ms
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>CPU times: user 475 ms, sys: 251 ms, total: 726 ms
Wall time: 411 ms
</pre></div>
</div>
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;fit_time&#39;: array([0.06219172, 0.05723834, 0.05901527, 0.05594277, 0.05530119]),
&#39;score_time&#39;: array([0.02072406, 0.01340437, 0.01310992, 0.01340914, 0.01328731]),
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;fit_time&#39;: array([0.05962992, 0.05806112, 0.05891657, 0.05685925, 0.05641007]),
&#39;score_time&#39;: array([0.01352239, 0.0138371 , 0.01350832, 0.01330352, 0.01314974]),
&#39;test_score&#39;: array([0.79557785, 0.80049135, 0.79965192, 0.79873055, 0.80456593])}
</pre></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion python_scripts/02_numerical_pipeline_scaling.html
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,7 @@ <h2>Model fitting with preprocessing<a class="headerlink" href="#model-fitting-w
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The accuracy using a LogisticRegression is 0.807 with a fitting time of 0.130 seconds in 60 iterations
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The accuracy using a LogisticRegression is 0.807 with a fitting time of 0.134 seconds in 60 iterations
</pre></div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions python_scripts/03_categorical_pipeline.html
Original file line number Diff line number Diff line change
Expand Up @@ -2078,8 +2078,8 @@ <h2>Evaluate our predictive pipeline<a class="headerlink" href="#evaluate-our-pr
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;fit_time&#39;: array([0.1831758 , 0.1687727 , 0.17786264, 0.18215322, 0.17073154]),
&#39;score_time&#39;: array([0.02293634, 0.02322912, 0.02242661, 0.02430534, 0.02228951]),
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;fit_time&#39;: array([0.17973423, 0.16796279, 0.17482829, 0.17987633, 0.1681819 ]),
&#39;score_time&#39;: array([0.02228045, 0.02242637, 0.02157307, 0.02428603, 0.02156115]),
&#39;test_score&#39;: array([0.83232675, 0.83570478, 0.82831695, 0.83292383, 0.83497133])}
</pre></div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions python_scripts/03_categorical_pipeline_column_transformer.html
Original file line number Diff line number Diff line change
Expand Up @@ -1571,8 +1571,8 @@ <h2>Evaluation of the model with cross-validation<a class="headerlink" href="#ev
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;fit_time&#39;: array([0.25394678, 0.25306678, 0.22307277, 0.24534893, 0.26477003]),
&#39;score_time&#39;: array([0.02737975, 0.02651834, 0.03650928, 0.02847409, 0.0261445 ]),
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;fit_time&#39;: array([0.25434685, 0.25564384, 0.22261763, 0.2406466 , 0.26352739]),
&#39;score_time&#39;: array([0.02670002, 0.02729535, 0.02718019, 0.028162 , 0.02679062]),
&#39;test_score&#39;: array([0.85116184, 0.84993346, 0.8482801 , 0.85257985, 0.85544636])}
</pre></div>
</div>
Expand Down Expand Up @@ -1644,8 +1644,8 @@ <h2>Fitting a more powerful model<a class="headerlink" href="#fitting-a-more-pow
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>CPU times: user 679 ms, sys: 11.4 ms, total: 690 ms
Wall time: 690 ms
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>CPU times: user 669 ms, sys: 15.7 ms, total: 685 ms
Wall time: 684 ms
</pre></div>
</div>
</div>
Expand All @@ -1657,7 +1657,7 @@ <h2>Fitting a more powerful model<a class="headerlink" href="#fitting-a-more-pow
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.8801899926295963
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.8814183932519859
</pre></div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion python_scripts/03_categorical_pipeline_ex_02.html
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ <h2>Reference pipeline (no numerical scaling and integer-coded categories)<a cla
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The mean cross-validation accuracy is: 0.873 ± 0.002 with a fitting time of 4.230
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The mean cross-validation accuracy is: 0.873 ± 0.002 with a fitting time of 4.233
</pre></div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions python_scripts/03_categorical_pipeline_sol_02.html
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ <h2>Reference pipeline (no numerical scaling and integer-coded categories)<a cla
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The mean cross-validation accuracy is: 0.873 ± 0.002 with a fitting time of 4.248
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The mean cross-validation accuracy is: 0.874 ± 0.003 with a fitting time of 4.248
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -835,7 +835,7 @@ <h2>Scaling numerical features<a class="headerlink" href="#scaling-numerical-fea
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The mean cross-validation accuracy is: 0.873 ± 0.003 with a fitting time of 4.267
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The mean cross-validation accuracy is: 0.874 ± 0.002 with a fitting time of 4.258
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -891,7 +891,7 @@ <h2>One-hot encoding of categorical variables<a class="headerlink" href="#one-ho
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The mean cross-validation accuracy is: 0.873 ± 0.002 with a fitting time of 17.169
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The mean cross-validation accuracy is: 0.873 ± 0.003 with a fitting time of 16.878
</pre></div>
</div>
</div>
Expand Down
76 changes: 38 additions & 38 deletions python_scripts/cross_validation_baseline.html
Original file line number Diff line number Diff line change
Expand Up @@ -743,13 +743,13 @@ <h1>Comparing model performance with a simple baseline<a class="headerlink" href
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>count 30.000000
mean 45.637861
std 1.170229
min 43.175110
25% 44.825677
50% 45.639125
75% 46.514792
max 47.742172
mean 45.738234
std 1.202376
min 43.087492
25% 45.055968
50% 45.764180
75% 46.742279
max 48.154477
Name: Decision tree regressor, dtype: float64
</pre></div>
</div>
Expand Down Expand Up @@ -826,152 +826,152 @@ <h1>Comparing model performance with a simple baseline<a class="headerlink" href
<tbody>
<tr>
<th>0</th>
<td>46.592386</td>
<td>46.762154</td>
<td>90.713153</td>
</tr>
<tr>
<th>1</th>
<td>46.523763</td>
<td>46.682655</td>
<td>90.539353</td>
</tr>
<tr>
<th>2</th>
<td>44.716731</td>
<td>44.507188</td>
<td>91.941912</td>
</tr>
<tr>
<th>3</th>
<td>43.891149</td>
<td>43.781727</td>
<td>90.213912</td>
</tr>
<tr>
<th>4</th>
<td>47.742172</td>
<td>48.154477</td>
<td>92.015862</td>
</tr>
<tr>
<th>5</th>
<td>44.830272</td>
<td>45.051056</td>
<td>90.542490</td>
</tr>
<tr>
<th>6</th>
<td>44.225642</td>
<td>44.244638</td>
<td>89.757566</td>
</tr>
<tr>
<th>7</th>
<td>44.824146</td>
<td>44.363026</td>
<td>92.477244</td>
</tr>
<tr>
<th>8</th>
<td>45.037734</td>
<td>45.222227</td>
<td>90.947952</td>
</tr>
<tr>
<th>9</th>
<td>44.225159</td>
<td>45.070704</td>
<td>91.991373</td>
</tr>
<tr>
<th>10</th>
<td>46.208717</td>
<td>46.800577</td>
<td>92.023571</td>
</tr>
<tr>
<th>11</th>
<td>45.656263</td>
<td>46.007645</td>
<td>90.556965</td>
</tr>
<tr>
<th>12</th>
<td>45.540615</td>
<td>45.688677</td>
<td>91.539567</td>
</tr>
<tr>
<th>13</th>
<td>45.686792</td>
<td>45.793358</td>
<td>91.185225</td>
</tr>
<tr>
<th>14</th>
<td>47.260021</td>
<td>46.854835</td>
<td>92.298971</td>
</tr>
<tr>
<th>15</th>
<td>44.144881</td>
<td>44.270414</td>
<td>91.084639</td>
</tr>
<tr>
<th>16</th>
<td>45.818771</td>
<td>46.170299</td>
<td>90.984471</td>
</tr>
<tr>
<th>17</th>
<td>46.824750</td>
<td>46.937056</td>
<td>89.981744</td>
</tr>
<tr>
<th>18</th>
<td>45.289211</td>
<td>45.097156</td>
<td>90.547140</td>
</tr>
<tr>
<th>19</th>
<td>47.158012</td>
<td>47.304524</td>
<td>89.820219</td>
</tr>
<tr>
<th>20</th>
<td>43.175110</td>
<td>43.087492</td>
<td>91.768721</td>
</tr>
<tr>
<th>21</th>
<td>46.167966</td>
<td>46.183518</td>
<td>92.305556</td>
</tr>
<tr>
<th>22</th>
<td>45.148490</td>
<td>45.664405</td>
<td>90.503017</td>
</tr>
<tr>
<th>23</th>
<td>46.797885</td>
<td>47.137156</td>
<td>92.147974</td>
</tr>
<tr>
<th>24</th>
<td>46.103920</td>
<td>45.735001</td>
<td>91.386320</td>
</tr>
<tr>
<th>25</th>
<td>45.613319</td>
<td>46.074533</td>
<td>90.815660</td>
</tr>
<tr>
<th>26</th>
<td>44.188829</td>
<td>44.417633</td>
<td>92.216574</td>
</tr>
<tr>
<th>27</th>
<td>46.487879</td>
<td>46.388824</td>
<td>90.107460</td>
</tr>
<tr>
<th>28</th>
<td>45.621987</td>
<td>45.299989</td>
<td>90.620318</td>
</tr>
<tr>
<th>29</th>
<td>47.633257</td>
<td>47.394084</td>
<td>91.165331</td>
</tr>
</tbody>
Expand All @@ -992,7 +992,7 @@ <h1>Comparing model performance with a simple baseline<a class="headerlink" href
</div>
</div>
<div class="cell_output docutils container">
<img alt="../_images/3d3fdf92d4180fd1d4ac7382ea70912f17e8915c8892514bc90d859e17f19ae7.png" src="../_images/3d3fdf92d4180fd1d4ac7382ea70912f17e8915c8892514bc90d859e17f19ae7.png" />
<img alt="../_images/6dd818d378cd4cde2c0e154498070e9d1f841b9dbe65ef41b2eca50218bf5941.png" src="../_images/6dd818d378cd4cde2c0e154498070e9d1f841b9dbe65ef41b2eca50218bf5941.png" />
</div>
</div>
<p>We see that the generalization performance of our decision tree is far from
Expand Down
2 changes: 1 addition & 1 deletion python_scripts/cross_validation_ex_01.html
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ <h1>📝 Exercise M2.01<a class="headerlink" href="#exercise-m2-01" title="Perma
linear model are different but we don’t need to know these details for the
exercise.</p>
<p>Also, this classifier can become more flexible/expressive by using a so-called
kernel that makes the model become non-linear. Again, no requirement regarding
kernel that makes the model become non-linear. Again, no undestanding regarding
the mathematics is required to accomplish this exercise.</p>
<p>We will use an RBF kernel where a parameter <code class="docutils literal notranslate"><span class="pre">gamma</span></code> allows to tune the
flexibility of the model.</p>
Expand Down
6 changes: 3 additions & 3 deletions python_scripts/cross_validation_grouping.html
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ <h1>Sample grouping<a class="headerlink" href="#sample-grouping" title="Permalin
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The average accuracy is 0.969 ± 0.010
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The average accuracy is 0.961 ± 0.005
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -797,7 +797,7 @@ <h1>Sample grouping<a class="headerlink" href="#sample-grouping" title="Permalin
</div>
</div>
<div class="cell_output docutils container">
<img alt="../_images/9943411be96f17a4d70f80b9fbf089e9966bd8a2a8d8d8c934762182642e641e.png" src="../_images/9943411be96f17a4d70f80b9fbf089e9966bd8a2a8d8d8c934762182642e641e.png" />
<img alt="../_images/f174f19699ef9893f342cc3c89a0e6718cea4e6974cce70b919b3d39f32404e8.png" src="../_images/f174f19699ef9893f342cc3c89a0e6718cea4e6974cce70b919b3d39f32404e8.png" />
</div>
</div>
<p>Shuffling the data results in a higher cross-validated test accuracy with less
Expand Down Expand Up @@ -1027,7 +1027,7 @@ <h1>Sample grouping<a class="headerlink" href="#sample-grouping" title="Permalin
</div>
</div>
<div class="cell_output docutils container">
<img alt="../_images/909a6a8a536adcd2d3dad57baf26d7d839cd07268ae0d42a4656e68fde831f60.png" src="../_images/909a6a8a536adcd2d3dad57baf26d7d839cd07268ae0d42a4656e68fde831f60.png" />
<img alt="../_images/80a414f11133c1cdfe1e0b28eeea7d6d2ac7a0764e99da9ce1595f5553a06d5b.png" src="../_images/80a414f11133c1cdfe1e0b28eeea7d6d2ac7a0764e99da9ce1595f5553a06d5b.png" />
</div>
</div>
<p>In conclusion, accounting for any sample grouping patterns is crucial when
Expand Down
2 changes: 1 addition & 1 deletion python_scripts/cross_validation_learning_curve.html
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ <h2>Learning curve<a class="headerlink" href="#learning-curve" title="Permalink
</div>
</div>
<div class="cell_output docutils container">
<img alt="../_images/4d876d94aee2719242808a6ed4e019522a6151a7593f327312c01968cdcc2def.png" src="../_images/4d876d94aee2719242808a6ed4e019522a6151a7593f327312c01968cdcc2def.png" />
<img alt="../_images/b8da38bdb89f08d430c8be24bf1d24c06eb737c8cf1bea6a378081549c126ed7.png" src="../_images/b8da38bdb89f08d430c8be24bf1d24c06eb737c8cf1bea6a378081549c126ed7.png" />
</div>
</div>
<p>Looking at the training error alone, we see that we get an error of 0 k$. It
Expand Down
Loading

0 comments on commit bb625e6

Please sign in to comment.