Skip to content

Commit 9bf7258

Browse files
committed
[ci skip] FIX Notebooks not updated by make notebooks (#743) 5cc989e
1 parent adf38a8 commit 9bf7258

File tree

4 files changed

+52
-30
lines changed

4 files changed

+52
-30
lines changed

_sources/python_scripts/trees_ex_01.py

+24-13
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@
1414
# %% [markdown]
1515
# # 📝 Exercise M5.01
1616
#
17-
# In the previous notebook, we showed how a tree with a depth of 1 level was
18-
# working. The aim of this exercise is to repeat part of the previous experiment
19-
# for a depth with 2 levels to show how the process of partitioning is repeated
20-
# over time.
17+
# In the previous notebook, we showed how a tree with 1 level depth works. The
18+
# aim of this exercise is to repeat part of the previous experiment for a tree
19+
# with 2 levels depth to show how such parameter affects the feature space
20+
# partitioning.
2121
#
22-
# Before to start, we will:
23-
#
24-
# * load the dataset;
25-
# * split the dataset into training and testing dataset;
26-
# * define the function to show the classification decision function.
22+
# We first load the penguins dataset and split it into a training and a testing
23+
# sets:
2724

2825
# %%
2926
import pandas as pd
@@ -48,10 +45,24 @@
4845

4946
# %% [markdown]
5047
# Create a decision tree classifier with a maximum depth of 2 levels and fit the
51-
# training data. Once this classifier trained, plot the data and the decision
52-
# boundary to see the benefit of increasing the depth. To plot the decision
53-
# boundary, you should import the class `DecisionBoundaryDisplay` from the
54-
# module `sklearn.inspection` as shown in the previous course notebook.
48+
# training data.
49+
50+
# %%
51+
# Write your code here.
52+
53+
# %% [markdown]
54+
# Now plot the data and the decision boundary of the trained classifier to see
55+
# the effect of increasing the depth of the tree.
56+
#
57+
# Hint: Use the class `DecisionBoundaryDisplay` from the module
58+
# `sklearn.inspection` as shown in previous course notebooks.
59+
#
60+
# ```{warning}
61+
# At this time, it is not possible to use `response_method="predict_proba"` for
62+
# multiclass problems. This is a planned feature for a future version of
63+
# scikit-learn. In the mean time, you can use `response_method="predict"`
64+
# instead.
65+
# ```
5566

5667
# %%
5768
# Write your code here.

appendix/notebook_timings.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1173,9 +1173,9 @@ <h1>Notebook timings<a class="headerlink" href="#notebook-timings" title="Permal
11731173
<td><p></p></td>
11741174
</tr>
11751175
<tr class="row-odd"><td><p><a class="xref doc reference internal" href="../python_scripts/trees_ex_01.html"><span class="doc">python_scripts/trees_ex_01</span></a></p></td>
1176-
<td><p>2023-10-20 14:19</p></td>
1176+
<td><p>2023-10-27 09:59</p></td>
11771177
<td><p>cache</p></td>
1178-
<td><p>2.0</p></td>
1178+
<td><p>2.4</p></td>
11791179
<td><p></p></td>
11801180
</tr>
11811181
<tr class="row-even"><td><p><a class="xref doc reference internal" href="../python_scripts/trees_ex_02.html"><span class="doc">python_scripts/trees_ex_02</span></a></p></td>

python_scripts/trees_ex_01.html

+25-14
Original file line numberDiff line numberDiff line change
@@ -683,16 +683,12 @@ <h1>📝 Exercise M5.01</h1>
683683

684684
<section class="tex2jax_ignore mathjax_ignore" id="exercise-m5-01">
685685
<h1>📝 Exercise M5.01<a class="headerlink" href="#exercise-m5-01" title="Permalink to this heading">#</a></h1>
686-
<p>In the previous notebook, we showed how a tree with a depth of 1 level was
687-
working. The aim of this exercise is to repeat part of the previous experiment
688-
for a depth with 2 levels to show how the process of partitioning is repeated
689-
over time.</p>
690-
<p>Before to start, we will:</p>
691-
<ul class="simple">
692-
<li><p>load the dataset;</p></li>
693-
<li><p>split the dataset into training and testing dataset;</p></li>
694-
<li><p>define the function to show the classification decision function.</p></li>
695-
</ul>
686+
<p>In the previous notebook, we showed how a tree with 1 level depth works. The
687+
aim of this exercise is to repeat part of the previous experiment for a tree
688+
with 2 levels depth to show how such parameter affects the feature space
689+
partitioning.</p>
690+
<p>We first load the penguins dataset and split it into a training and a testing
691+
sets:</p>
696692
<div class="cell docutils container">
697693
<div class="cell_input docutils container">
698694
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
@@ -722,10 +718,25 @@ <h1>📝 Exercise M5.01<a class="headerlink" href="#exercise-m5-01" title="Perma
722718
</div>
723719
</div>
724720
<p>Create a decision tree classifier with a maximum depth of 2 levels and fit the
725-
training data. Once this classifier trained, plot the data and the decision
726-
boundary to see the benefit of increasing the depth. To plot the decision
727-
boundary, you should import the class <code class="docutils literal notranslate"><span class="pre">DecisionBoundaryDisplay</span></code> from the
728-
module <code class="docutils literal notranslate"><span class="pre">sklearn.inspection</span></code> as shown in the previous course notebook.</p>
721+
training data.</p>
722+
<div class="cell docutils container">
723+
<div class="cell_input docutils container">
724+
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># Write your code here.</span>
725+
</pre></div>
726+
</div>
727+
</div>
728+
</div>
729+
<p>Now plot the data and the decision boundary of the trained classifier to see
730+
the effect of increasing the depth of the tree.</p>
731+
<p>Hint: Use the class <code class="docutils literal notranslate"><span class="pre">DecisionBoundaryDisplay</span></code> from the module
732+
<code class="docutils literal notranslate"><span class="pre">sklearn.inspection</span></code> as shown in previous course notebooks.</p>
733+
<div class="admonition warning">
734+
<p class="admonition-title">Warning</p>
735+
<p>At this time, it is not possible to use <code class="docutils literal notranslate"><span class="pre">response_method=&quot;predict_proba&quot;</span></code> for
736+
multiclass problems. This is a planned feature for a future version of
737+
scikit-learn. In the mean time, you can use <code class="docutils literal notranslate"><span class="pre">response_method=&quot;predict&quot;</span></code>
738+
instead.</p>
739+
</div>
729740
<div class="cell docutils container">
730741
<div class="cell_input docutils container">
731742
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># Write your code here.</span>

searchindex.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)