Skip to content

Commit 5c708c8

Browse files
CI: Update docs for v1.25.2 (ec782cc51a24c6a99aa7354507a0faa7e86f8fe5)
1 parent bc35a76 commit 5c708c8

File tree

8 files changed

+1602
-1557
lines changed

8 files changed

+1602
-1557
lines changed

convergence.svg

Lines changed: 282 additions & 284 deletions
Loading

convergence2.svg

Lines changed: 307 additions & 216 deletions
Loading

doc/index.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.

doc/sambo/index.html

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
6-
<meta name="generator" content="pdoc3 0.11.5">
6+
<meta name="generator" content="pdoc3 0.11.6">
77
<title>sambo API documentation</title>
88
<meta name="description" content="SAMBO - **Sequential and Model-Based Optimization** [in Python] …">
99
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
@@ -53,22 +53,22 @@ <h1 id="sambo-sequential-and-model-based-optimization-in-python">SAMBO - <strong
5353
<li><strong>function <code><a title="sambo.minimize" href="#sambo.minimize">minimize()</a></code></strong>, a near drop-in replacement for <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html"><code>scipy.optimize.minimize()</code></a>,</li>
5454
<li><strong>class <code><a title="sambo.Optimizer" href="#sambo.Optimizer">Optimizer</a></code></strong> with an ask-and-tell user interface,
5555
supporting arbitrary scikit-learn-like surrogate models,
56-
with Bayesian optimization estimators like <a href="https://www.gaussianprocess.org/gpml/chapters/RW.pdf">gaussian process</a> and <a href="https://doi.org/10.1007/s10994-006-6226-1">extra trees</a>,
56+
with <strong>Bayesian optimization estimators like <a href="https://www.gaussianprocess.org/gpml/chapters/RW.pdf">Gaussian processes</a> and <a href="https://doi.org/10.1007/s10994-006-6226-1">Extra Trees</a></strong>
5757
built in,</li>
58-
<li><strong><code><a title="sambo.SamboSearchCV" href="#sambo.SamboSearchCV">SamboSearchCV</a></code></strong>, a much faster drop-in replacement for
59-
scikit-learn's <a href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html"><code>GridSearchCV</code></a> and similar exhaustive
58+
<li><strong><code><a title="sambo.SamboSearchCV" href="#sambo.SamboSearchCV">SamboSearchCV</a></code></strong>, a much faster <strong>drop-in replacement</strong> for
59+
scikit-learn's <strong><a href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html"><code>GridSearchCV</code></a></strong> and similar exhaustive
6060
machine-learning hyper-parameter tuning methods,
6161
but compared to unpredictable stochastic methods, <em>informed</em>.</li>
6262
</ul>
6363
<p>The algorithms and methods implemented by or used in this package are:</p>
6464
<ul>
65-
<li><a href="http://doi.org/10.1007/s10898-018-0645-y">simplical homology global optimization</a> (SHGO), customizing the <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.shgo.html">implementation from SciPy</a>,</li>
66-
<li>surrogate machine learning model-based optimization,</li>
67-
<li><a href="https://doi.org/10.1007/BF00939380">shuffled complex evolution</a> (SCE-UA with improvements).</li>
65+
<li><strong><a href="http://doi.org/10.1007/s10898-018-0645-y">simplical homology global optimization</a> (SHGO)</strong>, reinitializing the <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.shgo.html">implementation from SciPy</a>,</li>
66+
<li><strong>surrogate</strong> machine learning <strong>model</strong>-based optimization,</li>
67+
<li><a href="https://doi.org/10.1007/BF00939380">shuffled complex evolution</a> (<strong>SCE-UA</strong> with improvements).</li>
6868
</ul>
69-
<p>This open-source project was heavily <strong>inspired by <em>scikit-optimize</em></strong> project,
70-
which now seems helplessly defunct.</p>
71-
<p>The project is one of the better optimizers around according to [benchmark].</p>
69+
<p>This open-source project was <strong>inspired by <em>scikit-optimize</em></strong>.
70+
The project is one of the better optimizers available according to
71+
<a href="https://sambo-optimization.github.io/#benchmark">benchmark</a>.</p>
7272
<p>† The contained algorithms seek to <em>minimize</em> your objective <code>f(x)</code>.
7373
If you instead need the <em>maximum</em>, simply minimize <code>-f(x)</code>. 💡</p>
7474
</section>
@@ -95,7 +95,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
9595
<details class="source">
9696
<summary>
9797
<span>Expand source code</span>
98-
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_minimize.py#L12-L231" class="git-link" target="_blank">Browse git</a>
98+
<a href="https://github.com/sambo-optimization/sambo/blob/ec782cc51a24c6a99aa7354507a0faa7e86f8fe5/sambo/_minimize.py#L12-L236" class="git-link" target="_blank">Browse git</a>
9999
</summary>
100100
<pre><code class="python">def minimize(
101101
fun: Callable[[np.ndarray], float],
@@ -136,25 +136,30 @@ <h2 class="section-title" id="header-functions">Functions</h2>
136136
Bounds for parameter variables.
137137
Should be a sequence of (min, max) pairs for each dimension,
138138
or an enumeration of nominal values. For any dimension,
139-
if `min` and `max` are integers, the dimension is assumed to be _integral_.
140-
If `min` or `max` are floats, the dimension is assumed to be _real_.
141-
In all other cases including if more than two values are provided,
142-
the dimension is assumed to be an _enumeration_ of values.
139+
**if `min` and `max` are integers**, the dimension is assumed to be _integral_
140+
on interval `[min, max)` (see warning below).
141+
If `min` or `max` are **floats**, the dimension is assumed to be _real_.
142+
In all other cases including if more than two values are specified,
143+
the dimension is assumed to be that ([nominal]) _enumeration_ of values.
143144
See _Examples_ below.
144145

145146
.. note:: Nominals are represented as ordinals
146-
Categorical (nominal) enumerations, although often not inherently ordered,
147+
Categorical ([nominal]) enumerations, although often not inherently ordered,
147148
are internally represented as integral dimensions.
148149
If this appears to significantly affect your results
149150
(e.g. if your nominals span many cases),
150151
you may need to [one-hot encode] your nominal variables manually.
151152

153+
[nominal]: https://en.wikipedia.org/wiki/Level_of_measurement#Nominal_level
152154
[one-hot encode]: https://en.wikipedia.org/wiki/One-hot
153155

154156
.. warning:: Mind the dot
155157
If optimizing your problem fails to produce expected results,
156158
make sure you&#39;re not specifying integer dimensions where real
157-
floating values would make more sense.
159+
(floating) values are expected. E.g.:
160+
161+
bounds = [(-2, 2)] * 2 # A 2D grid of {-2, -1, 0, 1}²
162+
bounds = [(-2., 2.)] # A 1D dimension of ~ np.linspace(-2., 2., 1/eps)
158163

159164
constraints : Callable[[np.ndarray], bool], optional
160165
Function representing constraints.
@@ -334,14 +339,15 @@ <h2 id="parameters">Parameters</h2>
334339
<p>Bounds for parameter variables.
335340
Should be a sequence of (min, max) pairs for each dimension,
336341
or an enumeration of nominal values. For any dimension,
337-
if <code>min</code> and <code>max</code> are integers, the dimension is assumed to be <em>integral</em>.
338-
If <code>min</code> or <code>max</code> are floats, the dimension is assumed to be <em>real</em>.
339-
In all other cases including if more than two values are provided,
340-
the dimension is assumed to be an <em>enumeration</em> of values.
342+
<strong>if <code>min</code> and <code>max</code> are integers</strong>, the dimension is assumed to be <em>integral</em>
343+
on interval <code>[min, max)</code> (see warning below).
344+
If <code>min</code> or <code>max</code> are <strong>floats</strong>, the dimension is assumed to be <em>real</em>.
345+
In all other cases including if more than two values are specified,
346+
the dimension is assumed to be that (<a href="https://en.wikipedia.org/wiki/Level_of_measurement#Nominal_level">nominal</a>) <em>enumeration</em> of values.
341347
See <em>Examples</em> below.</p>
342348
<div class="admonition note">
343349
<p class="admonition-title">Note:&ensp;Nominals are represented as ordinals</p>
344-
<p>Categorical (nominal) enumerations, although often not inherently ordered,
350+
<p>Categorical (<a href="https://en.wikipedia.org/wiki/Level_of_measurement#Nominal_level">nominal</a>) enumerations, although often not inherently ordered,
345351
are internally represented as integral dimensions.
346352
If this appears to significantly affect your results
347353
(e.g. if your nominals span many cases),
@@ -351,7 +357,10 @@ <h2 id="parameters">Parameters</h2>
351357
<p class="admonition-title">Warning:&ensp;Mind the dot</p>
352358
<p>If optimizing your problem fails to produce expected results,
353359
make sure you're not specifying integer dimensions where real
354-
floating values would make more sense.</p>
360+
(floating) values are expected. E.g.:</p>
361+
<pre><code>bounds = [(-2, 2)] * 2 # A 2D grid of {-2, -1, 0, 1}²
362+
bounds = [(-2., 2.)] # A 1D dimension of ~ np.linspace(-2., 2., 1/eps)
363+
</code></pre>
355364
</div>
356365
</dd>
357366
<dt><strong><code>constraints</code></strong> :&ensp;<code>Callable[[np.ndarray], bool]</code>, optional</dt>
@@ -481,7 +490,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
481490
<details class="source">
482491
<summary>
483492
<span>Expand source code</span>
484-
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_util.py#L91-L104" class="git-link" target="_blank">Browse git</a>
493+
<a href="https://github.com/sambo-optimization/sambo/blob/ec782cc51a24c6a99aa7354507a0faa7e86f8fe5/sambo/_util.py#L93-L106" class="git-link" target="_blank">Browse git</a>
485494
</summary>
486495
<pre><code class="python">class OptimizeResult(_OptimizeResult):
487496
&#34;&#34;&#34;
@@ -554,7 +563,7 @@ <h3>Class variables</h3>
554563
<details class="source">
555564
<summary>
556565
<span>Expand source code</span>
557-
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_smbo.py#L21-L555" class="git-link" target="_blank">Browse git</a>
566+
<a href="https://github.com/sambo-optimization/sambo/blob/ec782cc51a24c6a99aa7354507a0faa7e86f8fe5/sambo/_smbo.py#L22-L556" class="git-link" target="_blank">Browse git</a>
558567
</summary>
559568
<pre><code class="python">class Optimizer:
560569
&#34;&#34;&#34;
@@ -781,7 +790,7 @@ <h3>Class variables</h3>
781790
def _predict(self, X):
782791
means, stds, masks = [], [], []
783792
for estimator in self.estimators:
784-
X_batched = [X[i:i+10_000] for i in range(0, len(X), 10_000)]
793+
X_batched = [X[i:i + 10_000] for i in range(0, len(X), 10_000)]
785794
try:
786795
mean, std = np.concatenate(
787796
[estimator.predict(X, return_std=True) for X in X_batched], axis=1)
@@ -1197,7 +1206,7 @@ <h3>Methods</h3>
11971206
<details class="source">
11981207
<summary>
11991208
<span>Expand source code</span>
1200-
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_smbo.py#L285-L366" class="git-link" target="_blank">Browse git</a>
1209+
<a href="https://github.com/sambo-optimization/sambo/blob/ec782cc51a24c6a99aa7354507a0faa7e86f8fe5/sambo/_smbo.py#L286-L367" class="git-link" target="_blank">Browse git</a>
12011210
</summary>
12021211
<pre><code class="python">def ask(
12031212
self,
@@ -1330,7 +1339,7 @@ <h2 id="examples">Examples</h2>
13301339
<details class="source">
13311340
<summary>
13321341
<span>Expand source code</span>
1333-
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_smbo.py#L428-L525" class="git-link" target="_blank">Browse git</a>
1342+
<a href="https://github.com/sambo-optimization/sambo/blob/ec782cc51a24c6a99aa7354507a0faa7e86f8fe5/sambo/_smbo.py#L429-L526" class="git-link" target="_blank">Browse git</a>
13341343
</summary>
13351344
<pre><code class="python">def run(self, *,
13361345
max_iter: Optional[int] = None,
@@ -1468,7 +1477,7 @@ <h2 id="examples">Examples</h2>
14681477
<details class="source">
14691478
<summary>
14701479
<span>Expand source code</span>
1471-
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_smbo.py#L376-L426" class="git-link" target="_blank">Browse git</a>
1480+
<a href="https://github.com/sambo-optimization/sambo/blob/ec782cc51a24c6a99aa7354507a0faa7e86f8fe5/sambo/_smbo.py#L377-L427" class="git-link" target="_blank">Browse git</a>
14721481
</summary>
14731482
<pre><code class="python">def tell(self, y: float | list[float],
14741483
x: Optional[float | tuple[float] | list[tuple[float]]] = None):
@@ -1555,7 +1564,7 @@ <h2 id="examples">Examples</h2>
15551564
<details class="source">
15561565
<summary>
15571566
<span>Expand source code</span>
1558-
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_smbo.py#L527-L555" class="git-link" target="_blank">Browse git</a>
1567+
<a href="https://github.com/sambo-optimization/sambo/blob/ec782cc51a24c6a99aa7354507a0faa7e86f8fe5/sambo/_smbo.py#L528-L556" class="git-link" target="_blank">Browse git</a>
15591568
</summary>
15601569
<pre><code class="python">def top_k(self, k: int = 1):
15611570
&#34;&#34;&#34;
@@ -1619,7 +1628,7 @@ <h2 id="examples">Examples</h2>
16191628
<details class="source">
16201629
<summary>
16211630
<span>Expand source code</span>
1622-
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_estimators.py#L112-L200" class="git-link" target="_blank">Browse git</a>
1631+
<a href="https://github.com/sambo-optimization/sambo/blob/ec782cc51a24c6a99aa7354507a0faa7e86f8fe5/sambo/_estimators.py#L112-L200" class="git-link" target="_blank">Browse git</a>
16231632
</summary>
16241633
<pre><code class="python">class SamboSearchCV(BaseSearchCV):
16251634
&#34;&#34;&#34;
@@ -1755,7 +1764,8 @@ <h3>Ancestors</h3>
17551764
<li>sklearn.model_selection._search.BaseSearchCV</li>
17561765
<li>sklearn.base.MetaEstimatorMixin</li>
17571766
<li>sklearn.base.BaseEstimator</li>
1758-
<li>sklearn.utils._estimator_html_repr._HTMLDocumentationLinkMixin</li>
1767+
<li>sklearn.utils._repr_html.base.ReprHTMLMixin</li>
1768+
<li>sklearn.utils._repr_html.base._HTMLDocumentationLinkMixin</li>
17591769
<li>sklearn.utils._metadata_requests._MetadataRequester</li>
17601770
</ul>
17611771
</dd>
@@ -1866,7 +1876,7 @@ <h4><code><a title="sambo.SamboSearchCV" href="#sambo.SamboSearchCV">SamboSearch
18661876
</main>
18671877
<footer id="footer">
18681878
<p><span style="color:#ddd">&#21328;</span></p>
1869-
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.5</a>.</p>
1879+
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.6</a>.</p>
18701880
</footer>
18711881
</body>
18721882
</html>

doc/sambo/plot.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
6-
<meta name="generator" content="pdoc3 0.11.5">
6+
<meta name="generator" content="pdoc3 0.11.6">
77
<title>sambo.plot API documentation</title>
88
<meta name="description" content="The module contains **functions for plotting**
99
convergence, regret, partial dependence, sequence of evaluations
@@ -48,6 +48,7 @@ <h1 class="title">Module <code>sambo.plot</code></h1>
4848
<h2 id="example">Example</h2>
4949
<pre><code class="language-python-repl">&gt;&gt;&gt; import matplotlib.pyplot as plt
5050
&gt;&gt;&gt; from scipy.optimize import rosen
51+
&gt;&gt;&gt; from sambo import minimize
5152
&gt;&gt;&gt; result = minimize(rosen, bounds=[(-2, 2), (-2, 2)],
5253
... constraints=lambda x: sum(x) &lt;= len(x))
5354
&gt;&gt;&gt; plot_convergence(result)
@@ -71,7 +72,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
7172
<details class="source">
7273
<summary>
7374
<span>Expand source code</span>
74-
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/plot.py#L38-L103" class="git-link" target="_blank">Browse git</a>
75+
<a href="https://github.com/sambo-optimization/sambo/blob/ec782cc51a24c6a99aa7354507a0faa7e86f8fe5/sambo/plot.py#L39-L104" class="git-link" target="_blank">Browse git</a>
7576
</summary>
7677
<pre><code class="python">def plot_convergence(
7778
*results: OptimizeResult | tuple[str, OptimizeResult],
@@ -129,7 +130,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
129130
mins = np.minimum.accumulate(result.funv)
130131

131132
ax.plot(range(1, nfev + 1), mins,
132-
label=name, marker=next(MARKER), markevery=(.05 + .05*i, .2),
133+
label=name, marker=next(MARKER), markevery=(.05 + .05 * i, .2),
133134
linestyle=&#39;--&#39;, alpha=.7, markersize=6, lw=2)
134135

135136
if true_minimum is not None:
@@ -168,7 +169,7 @@ <h2 id="example">Example</h2>
168169
<details class="source">
169170
<summary>
170171
<span>Expand source code</span>
171-
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/plot.py#L656-L757" class="git-link" target="_blank">Browse git</a>
172+
<a href="https://github.com/sambo-optimization/sambo/blob/ec782cc51a24c6a99aa7354507a0faa7e86f8fe5/sambo/plot.py#L661-L762" class="git-link" target="_blank">Browse git</a>
172173
</summary>
173174
<pre><code class="python">def plot_evaluations(
174175
result: OptimizeResult,
@@ -323,7 +324,7 @@ <h2 id="example">Example</h2>
323324
<details class="source">
324325
<summary>
325326
<span>Expand source code</span>
326-
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/plot.py#L471-L653" class="git-link" target="_blank">Browse git</a>
327+
<a href="https://github.com/sambo-optimization/sambo/blob/ec782cc51a24c6a99aa7354507a0faa7e86f8fe5/sambo/plot.py#L476-L658" class="git-link" target="_blank">Browse git</a>
327328
</summary>
328329
<pre><code class="python">def plot_objective(
329330
result: OptimizeResult,
@@ -589,7 +590,7 @@ <h2 id="example">Example</h2>
589590
<details class="source">
590591
<summary>
591592
<span>Expand source code</span>
592-
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/plot.py#L128-L203" class="git-link" target="_blank">Browse git</a>
593+
<a href="https://github.com/sambo-optimization/sambo/blob/ec782cc51a24c6a99aa7354507a0faa7e86f8fe5/sambo/plot.py#L133-L208" class="git-link" target="_blank">Browse git</a>
593594
</summary>
594595
<pre><code class="python">def plot_regret(
595596
*results: OptimizeResult | tuple[str, OptimizeResult],
@@ -660,7 +661,7 @@ <h2 id="example">Example</h2>
660661
for i in range(1, nfev + 1)]
661662

662663
ax.plot(range(1, nfev + 1), regrets,
663-
label=name, marker=next(MARKER), markevery=(.05 + .05*i, .2),
664+
label=name, marker=next(MARKER), markevery=(.05 + .05 * i, .2),
664665
linestyle=&#39;--&#39;, alpha=.7, markersize=6, lw=2)
665666

666667
if name is not None:
@@ -770,7 +771,7 @@ <h2 id="example">Example</h2>
770771
</main>
771772
<footer id="footer">
772773
<p><span style="color:#ddd">&#21328;</span></p>
773-
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.5</a>.</p>
774+
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.6</a>.</p>
774775
</footer>
775776
</body>
776777
</html>

0 commit comments

Comments
 (0)