Skip to content

Commit 713fd30

Browse files
committed
[ci skip] minor improvements in wording and import statement order (#841)
* minor improvment in wording and import statement order * use pre-commit hooks 1c40b1c
1 parent df4909a commit 713fd30

File tree

8 files changed

+14
-10
lines changed

8 files changed

+14
-10
lines changed

_sources/python_scripts/linear_models_ex_02.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# disease. This would depend on the patient's Body Mass Index which is defined
3131
# as `weight / height ** 2`.
3232
#
33-
# We load the dataset penguins dataset. We first use a set of 3 numerical
33+
# We load the penguins dataset. We first use a set of 3 numerical
3434
# features to predict the target, i.e. the body mass of the penguin.
3535

3636
# %% [markdown]

_sources/python_scripts/linear_models_sol_02.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# disease. This would depend on the patient's Body Mass Index which is defined
2525
# as `weight / height ** 2`.
2626
#
27-
# We load the dataset penguins dataset. We first use a set of 3 numerical
27+
# We load the penguins dataset. We first use a set of 3 numerical
2828
# features to predict the target, i.e. the body mass of the penguin.
2929

3030
# %% [markdown]

_sources/python_scripts/linear_regression_non_linear_link.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676

7777

7878
# %%
79+
from sklearn.metrics import mean_squared_error
80+
81+
7982
def fit_score_plot_regression(model, title=None):
8083
model.fit(data, target)
8184
target_predicted = model.predict(data)
@@ -95,7 +98,6 @@ def fit_score_plot_regression(model, title=None):
9598

9699
# %%
97100
from sklearn.linear_model import LinearRegression
98-
from sklearn.metrics import mean_squared_error
99101

100102
linear_regression = LinearRegression()
101103
linear_regression

appendix/notebook_timings.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,9 +1073,9 @@ <h1>Notebook timings<a class="headerlink" href="#notebook-timings" title="Link t
10731073
<td><p></p></td>
10741074
</tr>
10751075
<tr class="row-even"><td><p><a class="xref doc reference internal" href="../python_scripts/linear_regression_non_linear_link.html"><span class="doc">python_scripts/linear_regression_non_linear_link</span></a></p></td>
1076-
<td><p>2025-05-09 15:40</p></td>
1076+
<td><p>2025-06-02 13:58</p></td>
10771077
<td><p>cache</p></td>
1078-
<td><p>3.79</p></td>
1078+
<td><p>5.21</p></td>
10791079
<td><p></p></td>
10801080
</tr>
10811081
<tr class="row-odd"><td><p><a class="xref doc reference internal" href="../python_scripts/linear_regression_without_sklearn.html"><span class="doc">python_scripts/linear_regression_without_sklearn</span></a></p></td>

python_scripts/linear_models_ex_02.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ <h1>📝 Exercise M4.02<a class="headerlink" href="#exercise-m4-02" title="Link
710710
classification model to decide if a patient has risk of developing a heart
711711
disease. This would depend on the patient’s Body Mass Index which is defined
712712
as <code class="docutils literal notranslate"><span class="pre">weight</span> <span class="pre">/</span> <span class="pre">height</span> <span class="pre">**</span> <span class="pre">2</span></code>.</p>
713-
<p>We load the dataset penguins dataset. We first use a set of 3 numerical
713+
<p>We load the penguins dataset. We first use a set of 3 numerical
714714
features to predict the target, i.e. the body mass of the penguin.</p>
715715
<div class="admonition note">
716716
<p class="admonition-title">Note</p>

python_scripts/linear_models_sol_02.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ <h1>📃 Solution for Exercise M4.02<a class="headerlink" href="#solution-for-ex
710710
classification model to decide if a patient has risk of developing a heart
711711
disease. This would depend on the patient’s Body Mass Index which is defined
712712
as <code class="docutils literal notranslate"><span class="pre">weight</span> <span class="pre">/</span> <span class="pre">height</span> <span class="pre">**</span> <span class="pre">2</span></code>.</p>
713-
<p>We load the dataset penguins dataset. We first use a set of 3 numerical
713+
<p>We load the penguins dataset. We first use a set of 3 numerical
714714
features to predict the target, i.e. the body mass of the penguin.</p>
715715
<div class="admonition note">
716716
<p class="admonition-title">Note</p>

python_scripts/linear_regression_non_linear_link.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,10 @@ <h1>Non-linear feature engineering for Linear Regression<a class="headerlink" hr
791791
that fits, scores and plots the different regression models.</p>
792792
<div class="cell docutils container">
793793
<div class="cell_input docutils container">
794-
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="k">def</span><span class="w"> </span><span class="nf">fit_score_plot_regression</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
794+
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span><span class="w"> </span><span class="nn">sklearn.metrics</span><span class="w"> </span><span class="kn">import</span> <span class="n">mean_squared_error</span>
795+
796+
797+
<span class="k">def</span><span class="w"> </span><span class="nf">fit_score_plot_regression</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
795798
<span class="n">model</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">target</span><span class="p">)</span>
796799
<span class="n">target_predicted</span> <span class="o">=</span> <span class="n">model</span><span class="o">.</span><span class="n">predict</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
797800
<span class="n">mse</span> <span class="o">=</span> <span class="n">mean_squared_error</span><span class="p">(</span><span class="n">target</span><span class="p">,</span> <span class="n">target_predicted</span><span class="p">)</span>
@@ -811,7 +814,6 @@ <h1>Non-linear feature engineering for Linear Regression<a class="headerlink" hr
811814
<div class="cell docutils container">
812815
<div class="cell_input docutils container">
813816
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span><span class="w"> </span><span class="nn">sklearn.linear_model</span><span class="w"> </span><span class="kn">import</span> <span class="n">LinearRegression</span>
814-
<span class="kn">from</span><span class="w"> </span><span class="nn">sklearn.metrics</span><span class="w"> </span><span class="kn">import</span> <span class="n">mean_squared_error</span>
815817

816818
<span class="n">linear_regression</span> <span class="o">=</span> <span class="n">LinearRegression</span><span class="p">()</span>
817819
<span class="n">linear_regression</span>

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)