Skip to content

Commit ee88b59

Browse files
Deployed 852b019 with MkDocs version: 1.6.0
1 parent c56a9e7 commit ee88b59

5 files changed

Lines changed: 207 additions & 205 deletions

File tree

reference/spotpython/utils/effects/index.html

Lines changed: 33 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4975,7 +4975,10 @@ <h2 id="spotpython.utils.effects.plot_all_partial_dependence" class="doc doc-hea
49754975

49764976
<details class="quote">
49774977
<summary>Source code in <code>spotpython/utils/effects.py</code></summary>
4978-
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">306</span>
4978+
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">303</span>
4979+
<span class="normal">304</span>
4980+
<span class="normal">305</span>
4981+
<span class="normal">306</span>
49794982
<span class="normal">307</span>
49804983
<span class="normal">308</span>
49814984
<span class="normal">309</span>
@@ -5040,10 +5043,7 @@ <h2 id="spotpython.utils.effects.plot_all_partial_dependence" class="doc doc-hea
50405043
<span class="normal">368</span>
50415044
<span class="normal">369</span>
50425045
<span class="normal">370</span>
5043-
<span class="normal">371</span>
5044-
<span class="normal">372</span>
5045-
<span class="normal">373</span>
5046-
<span class="normal">374</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">plot_all_partial_dependence</span><span class="p">(</span><span class="n">df</span><span class="p">,</span> <span class="n">df_target</span><span class="p">,</span> <span class="n">model</span><span class="o">=</span><span class="s2">&quot;GradientBoostingRegressor&quot;</span><span class="p">,</span> <span class="n">nrows</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">ncols</span><span class="o">=</span><span class="mi">6</span><span class="p">,</span> <span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="mi">15</span><span class="p">))</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
5046+
<span class="normal">371</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">plot_all_partial_dependence</span><span class="p">(</span><span class="n">df</span><span class="p">,</span> <span class="n">df_target</span><span class="p">,</span> <span class="n">model</span><span class="o">=</span><span class="s2">&quot;GradientBoostingRegressor&quot;</span><span class="p">,</span> <span class="n">nrows</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">ncols</span><span class="o">=</span><span class="mi">6</span><span class="p">,</span> <span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="mi">15</span><span class="p">))</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
50475047
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
50485048
<span class="sd"> Generates Partial Dependence Plots (PDPs) for every feature in a DataFrame against a target variable,</span>
50495049
<span class="sd"> arranged in a grid.</span>
@@ -5416,8 +5416,7 @@ <h2 id="spotpython.utils.effects.screening_plot" class="doc doc-heading">
54165416
</td>
54175417
<td>
54185418
<div class="doc-md-description">
5419-
<p>The screening plan matrix, typically structured
5420-
within a [0,1]^k box.</p>
5419+
<p>The screening plan matrix, typically structured within a [0,1]^k box.</p>
54215420
</div>
54225421
</td>
54235422
<td>
@@ -5431,8 +5430,7 @@ <h2 id="spotpython.utils.effects.screening_plot" class="doc doc-heading">
54315430
</td>
54325431
<td>
54335432
<div class="doc-md-description">
5434-
<p>The objective function to evaluate at each
5435-
design point in the screening plan.</p>
5433+
<p>The objective function to evaluate at each design point in the screening plan.</p>
54365434
</div>
54375435
</td>
54385436
<td>
@@ -5474,8 +5472,7 @@ <h2 id="spotpython.utils.effects.screening_plot" class="doc doc-heading">
54745472
</td>
54755473
<td>
54765474
<div class="doc-md-description">
5477-
<p>A list of variable names corresponding to
5478-
the design variables.</p>
5475+
<p>A list of variable names corresponding to the design variables.</p>
54795476
</div>
54805477
</td>
54815478
<td>
@@ -5489,9 +5486,8 @@ <h2 id="spotpython.utils.effects.screening_plot" class="doc doc-heading">
54895486
</td>
54905487
<td>
54915488
<div class="doc-md-description">
5492-
<p>A 2xk matrix where the first row contains
5493-
lower bounds and the second row contains upper bounds for
5494-
each variable.</p>
5489+
<p>A 2xk matrix where the first row contains lower bounds and
5490+
the second row contains upper bounds for each variable.</p>
54955491
</div>
54965492
</td>
54975493
<td>
@@ -5501,10 +5497,11 @@ <h2 id="spotpython.utils.effects.screening_plot" class="doc doc-heading">
55015497
<tr class="doc-section-item">
55025498
<td><code>show</code></td>
55035499
<td>
5500+
<code>bool</code>
55045501
</td>
55055502
<td>
55065503
<div class="doc-md-description">
5507-
<p>(bool): If True, the plot is displayed. Defaults to True.</p>
5504+
<p>If True, the plot is displayed. Defaults to True.</p>
55085505
</div>
55095506
</td>
55105507
<td>
@@ -5519,31 +5516,18 @@ <h2 id="spotpython.utils.effects.screening_plot" class="doc doc-heading">
55195516
<table>
55205517
<thead>
55215518
<tr>
5522-
<th>Type</th>
5519+
<th>Name</th> <th>Type</th>
55235520
<th>Description</th>
55245521
</tr>
55255522
</thead>
55265523
<tbody>
55275524
<tr class="doc-section-item">
5528-
<td>
5529-
</td>
5530-
<td>
5531-
<div class="doc-md-description">
5532-
<p>pd.DataFrame: A DataFrame containing three columns:
5533-
- &lsquo;varname&rsquo;: The name of each variable.
5534-
- &lsquo;mean&rsquo;: The mean of the elementary effects for each variable.
5535-
- &lsquo;sd&rsquo;: The standard deviation of the elementary effects for
5536-
each variable.</p>
5537-
</div>
5538-
</td>
5539-
</tr>
5540-
<tr class="doc-section-item">
5541-
<td>
5525+
<td><code>None</code></td> <td>
5526+
<code>None</code>
55425527
</td>
55435528
<td>
55445529
<div class="doc-md-description">
5545-
<p>or None: If print is set to False, a plot of the results is
5546-
generated instead of returning a DataFrame.</p>
5530+
<p>The function generates a plot of the results.</p>
55475531
</div>
55485532
</td>
55495533
</tr>
@@ -5652,38 +5636,32 @@ <h2 id="spotpython.utils.effects.screening_plot" class="doc doc-heading">
56525636
<span class="normal">297</span>
56535637
<span class="normal">298</span>
56545638
<span class="normal">299</span>
5655-
<span class="normal">300</span>
5656-
<span class="normal">301</span>
5657-
<span class="normal">302</span>
5658-
<span class="normal">303</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">screening_plot</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">fun</span><span class="p">,</span> <span class="n">xi</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">labels</span><span class="p">,</span> <span class="n">bounds</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">show</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
5639+
<span class="normal">300</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">screening_plot</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">fun</span><span class="p">,</span> <span class="n">xi</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">labels</span><span class="p">,</span> <span class="n">bounds</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">show</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
56595640
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Generates a plot with elementary effect screening metrics.</span>
56605641

56615642
<span class="sd"> This function calculates the mean and standard deviation of the</span>
56625643
<span class="sd"> elementary effects for a given set of design variables and plots</span>
56635644
<span class="sd"> the results.</span>
56645645

56655646
<span class="sd"> Args:</span>
5666-
<span class="sd"> X (np.ndarray): The screening plan matrix, typically structured</span>
5667-
<span class="sd"> within a [0,1]^k box.</span>
5668-
<span class="sd"> fun (object): The objective function to evaluate at each</span>
5669-
<span class="sd"> design point in the screening plan.</span>
5670-
<span class="sd"> xi (float): The elementary effect step length factor.</span>
5671-
<span class="sd"> p (int): Number of discrete levels along each dimension.</span>
5672-
<span class="sd"> labels (list of str): A list of variable names corresponding to</span>
5673-
<span class="sd"> the design variables.</span>
5674-
<span class="sd"> bounds (np.ndarray): A 2xk matrix where the first row contains</span>
5675-
<span class="sd"> lower bounds and the second row contains upper bounds for</span>
5676-
<span class="sd"> each variable.</span>
5677-
<span class="sd"> show: (bool): If True, the plot is displayed. Defaults to True.</span>
5647+
<span class="sd"> X (np.ndarray):</span>
5648+
<span class="sd"> The screening plan matrix, typically structured within a [0,1]^k box.</span>
5649+
<span class="sd"> fun (object):</span>
5650+
<span class="sd"> The objective function to evaluate at each design point in the screening plan.</span>
5651+
<span class="sd"> xi (float):</span>
5652+
<span class="sd"> The elementary effect step length factor.</span>
5653+
<span class="sd"> p (int):</span>
5654+
<span class="sd"> Number of discrete levels along each dimension.</span>
5655+
<span class="sd"> labels (list of str):</span>
5656+
<span class="sd"> A list of variable names corresponding to the design variables.</span>
5657+
<span class="sd"> bounds (np.ndarray):</span>
5658+
<span class="sd"> A 2xk matrix where the first row contains lower bounds and</span>
5659+
<span class="sd"> the second row contains upper bounds for each variable.</span>
5660+
<span class="sd"> show (bool):</span>
5661+
<span class="sd"> If True, the plot is displayed. Defaults to True.</span>
56785662

56795663
<span class="sd"> Returns:</span>
5680-
<span class="sd"> pd.DataFrame: A DataFrame containing three columns:</span>
5681-
<span class="sd"> - &#39;varname&#39;: The name of each variable.</span>
5682-
<span class="sd"> - &#39;mean&#39;: The mean of the elementary effects for each variable.</span>
5683-
<span class="sd"> - &#39;sd&#39;: The standard deviation of the elementary effects for</span>
5684-
<span class="sd"> each variable.</span>
5685-
<span class="sd"> or None: If print is set to False, a plot of the results is</span>
5686-
<span class="sd"> generated instead of returning a DataFrame.</span>
5664+
<span class="sd"> None: The function generates a plot of the results.</span>
56875665

56885666
<span class="sd"> Examples:</span>
56895667
<span class="sd"> &gt;&gt;&gt; import numpy as np</span>

0 commit comments

Comments
 (0)