Skip to content

Commit d415ca0

Browse files
CI: Update docs for v1.25.1 (a85f8fb9452ba14752943ce1587436f8394f6174)
1 parent bb804ad commit d415ca0

File tree

8 files changed

+508
-497
lines changed

8 files changed

+508
-497
lines changed

convergence.svg

Lines changed: 50 additions & 50 deletions
Loading

convergence2.svg

Lines changed: 66 additions & 66 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: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -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/ec7433286915d71bb7bb8f4e38758eca5c7171f6/sambo/_minimize.py#L12-L231" class="git-link" target="_blank">Browse git</a>
98+
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_minimize.py#L12-L231" class="git-link" target="_blank">Browse git</a>
9999
</summary>
100100
<pre><code class="python">def minimize(
101101
fun: Callable[[np.ndarray], float],
@@ -481,7 +481,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
481481
<details class="source">
482482
<summary>
483483
<span>Expand source code</span>
484-
<a href="https://github.com/sambo-optimization/sambo/blob/ec7433286915d71bb7bb8f4e38758eca5c7171f6/sambo/_util.py#L91-L104" class="git-link" target="_blank">Browse git</a>
484+
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_util.py#L91-L104" class="git-link" target="_blank">Browse git</a>
485485
</summary>
486486
<pre><code class="python">class OptimizeResult(_OptimizeResult):
487487
&#34;&#34;&#34;
@@ -554,7 +554,7 @@ <h3>Class variables</h3>
554554
<details class="source">
555555
<summary>
556556
<span>Expand source code</span>
557-
<a href="https://github.com/sambo-optimization/sambo/blob/ec7433286915d71bb7bb8f4e38758eca5c7171f6/sambo/_smbo.py#L21-L549" class="git-link" target="_blank">Browse git</a>
557+
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_smbo.py#L21-L555" class="git-link" target="_blank">Browse git</a>
558558
</summary>
559559
<pre><code class="python">class Optimizer:
560560
&#34;&#34;&#34;
@@ -809,21 +809,22 @@ <h3>Class variables</h3>
809809

810810
#: Acquisition functions for selecting the best candidates from the sample.
811811
#: Currently defined keys:
812-
#: &#34;UCB&#34; for upper confidence bound (`mean - kappa * std`).
812+
#: `&#34;LCB&#34;` — **lower confidence bound** (an inverse analog of &#34;UCB&#34;)
813+
#: which orders candidates by `mean - kappa * std`.
813814
#: [//]: # (No blank line here! bug in pdoc)
814815
#: .. note::
815816
#: To make any use of the `kappa` parameter, it is important for the
816817
#: estimator&#39;s `predict()` method to implement `return_std=` behavior.
817818
#: All built-in estimators (`&#34;gp&#34;`, `&#34;et&#34;`, `&#34;gb&#34;`) do so.
818819
ACQ_FUNCS: dict = {
819-
&#39;UCB&#39;: _UCB,
820+
&#39;LCB&#39;: _LCB,
820821
}
821822

822823
def ask(
823824
self,
824825
n_candidates: Optional[int] = None,
825826
*,
826-
acq_func: Optional[Callable] = ACQ_FUNCS[&#39;UCB&#39;],
827+
acq_func: Optional[Callable] = ACQ_FUNCS[&#39;LCB&#39;],
827828
kappa: float | list[float] = 0,
828829
) -&gt; np.ndarray:
829830
&#34;&#34;&#34;
@@ -836,20 +837,20 @@ <h3>Class variables</h3>
836837
Number of candidate solutions to propose.
837838
If not specified, the default value set during initialization is used.
838839

839-
acq_func : Callable, default ACQ_FUNCS[&#39;UCB&#39;]
840+
acq_func : Callable, default ACQ_FUNCS[&#39;LCB&#39;]
840841
Acquisition function used to guide the selection of candidate solutions.
841-
By default, upper confidence bound (i.e. `mean - kappa * std` where `mean`
842+
By default, lower confidence bound (i.e. `mean - kappa * std` where `mean`
842843
and `std` are surrogate models&#39; predicted results).
843844

844845
.. tip::
845-
[See the source][_ghs] for how `ACQ_FUNCS[&#39;UCB&#39;]` is implemeted.
846+
[See the source][_ghs] for how `ACQ_FUNCS[&#39;LCB&#39;]` is implemeted.
846847
The passed parameters are open to extension to accommodate
847848
alternative acquisition functions.
848849

849850
[_ghs]: https://github.com/search?q=repo%3Asambo-optimization%2Fsambo%20ACQ_FUNCS&amp;type=code
850851

851852
kappa : float or list[float], default 0
852-
The upper/lower-confidence-bound parameter, used by `acq_func`, that
853+
The lower-confidence-bound parameter, used by `acq_func`, that
853854
balances exploration (&lt;0) vs exploitation (&gt;0).
854855

855856
Can also be an array of values to use sequentially for `n_cadidates`.
@@ -902,7 +903,12 @@ <h3>Class variables</h3>
902903
self._X_ask.extend(map(tuple, X))
903904
return X
904905

906+
#: In `Optimizer.ask()`, sample this many points (per dimension) and
907+
#: use the estimator to _predict_ the objective values.
905908
POINTS_PER_DIM = 20_000
909+
910+
#: In `Optimizer.ask()`, sample _at most_ this many points. This increases
911+
#: computation time, but may also improve precision and convergence significantly.
906912
MAX_POINTS_PER_ITER = 80_000
907913

908914
def tell(self, y: float | list[float],
@@ -1162,7 +1168,8 @@ <h3>Class variables</h3>
11621168
<dd>
11631169
<div class="desc"><p>Acquisition functions for selecting the best candidates from the sample.
11641170
Currently defined keys:
1165-
"UCB" for upper confidence bound (<code>mean - kappa * std</code>).</p>
1171+
<code>"LCB"</code><strong>lower confidence bound</strong> (an inverse analog of "UCB")
1172+
which orders candidates by <code>mean - kappa * std</code>.</p>
11661173
<div class="admonition note">
11671174
<p class="admonition-title">Note</p>
11681175
<p>To make any use of the <code>kappa</code> parameter, it is important for the
@@ -1172,29 +1179,31 @@ <h3>Class variables</h3>
11721179
</dd>
11731180
<dt id="sambo.Optimizer.MAX_POINTS_PER_ITER"><code class="name">var <span class="ident">MAX_POINTS_PER_ITER</span></code></dt>
11741181
<dd>
1175-
<div class="desc"></div>
1182+
<div class="desc"><p>In <code><a title="sambo.Optimizer.ask" href="#sambo.Optimizer.ask">Optimizer.ask()</a></code>, sample <em>at most</em> this many points. This increases
1183+
computation time, but may also improve precision and convergence significantly.</p></div>
11761184
</dd>
11771185
<dt id="sambo.Optimizer.POINTS_PER_DIM"><code class="name">var <span class="ident">POINTS_PER_DIM</span></code></dt>
11781186
<dd>
1179-
<div class="desc"></div>
1187+
<div class="desc"><p>In <code><a title="sambo.Optimizer.ask" href="#sambo.Optimizer.ask">Optimizer.ask()</a></code>, sample this many points (per dimension) and
1188+
use the estimator to <em>predict</em> the objective values.</p></div>
11801189
</dd>
11811190
</dl>
11821191
<h3>Methods</h3>
11831192
<dl>
11841193
<dt id="sambo.Optimizer.ask"><code class="name flex">
1185-
<span>def <span class="ident">ask</span></span>(<span>self,<br>n_candidates: int | None = None,<br>*,<br>acq_func: Callable | None = &lt;function _UCB&gt;,<br>kappa: float | list[float] = 0) ‑> numpy.ndarray</span>
1194+
<span>def <span class="ident">ask</span></span>(<span>self,<br>n_candidates: int | None = None,<br>*,<br>acq_func: Callable | None = &lt;function _LCB&gt;,<br>kappa: float | list[float] = 0) ‑> numpy.ndarray</span>
11861195
</code></dt>
11871196
<dd>
11881197
<details class="source">
11891198
<summary>
11901199
<span>Expand source code</span>
1191-
<a href="https://github.com/sambo-optimization/sambo/blob/ec7433286915d71bb7bb8f4e38758eca5c7171f6/sambo/_smbo.py#L284-L365" class="git-link" target="_blank">Browse git</a>
1200+
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_smbo.py#L285-L366" class="git-link" target="_blank">Browse git</a>
11921201
</summary>
11931202
<pre><code class="python">def ask(
11941203
self,
11951204
n_candidates: Optional[int] = None,
11961205
*,
1197-
acq_func: Optional[Callable] = ACQ_FUNCS[&#39;UCB&#39;],
1206+
acq_func: Optional[Callable] = ACQ_FUNCS[&#39;LCB&#39;],
11981207
kappa: float | list[float] = 0,
11991208
) -&gt; np.ndarray:
12001209
&#34;&#34;&#34;
@@ -1207,20 +1216,20 @@ <h3>Methods</h3>
12071216
Number of candidate solutions to propose.
12081217
If not specified, the default value set during initialization is used.
12091218

1210-
acq_func : Callable, default ACQ_FUNCS[&#39;UCB&#39;]
1219+
acq_func : Callable, default ACQ_FUNCS[&#39;LCB&#39;]
12111220
Acquisition function used to guide the selection of candidate solutions.
1212-
By default, upper confidence bound (i.e. `mean - kappa * std` where `mean`
1221+
By default, lower confidence bound (i.e. `mean - kappa * std` where `mean`
12131222
and `std` are surrogate models&#39; predicted results).
12141223

12151224
.. tip::
1216-
[See the source][_ghs] for how `ACQ_FUNCS[&#39;UCB&#39;]` is implemeted.
1225+
[See the source][_ghs] for how `ACQ_FUNCS[&#39;LCB&#39;]` is implemeted.
12171226
The passed parameters are open to extension to accommodate
12181227
alternative acquisition functions.
12191228

12201229
[_ghs]: https://github.com/search?q=repo%3Asambo-optimization%2Fsambo%20ACQ_FUNCS&amp;type=code
12211230

12221231
kappa : float or list[float], default 0
1223-
The upper/lower-confidence-bound parameter, used by `acq_func`, that
1232+
The lower-confidence-bound parameter, used by `acq_func`, that
12241233
balances exploration (&lt;0) vs exploitation (&gt;0).
12251234

12261235
Can also be an array of values to use sequentially for `n_cadidates`.
@@ -1280,21 +1289,21 @@ <h2 id="parameters">Parameters</h2>
12801289
<dt><strong><code>n_candidates</code></strong> :&ensp;<code>int</code>, optional</dt>
12811290
<dd>Number of candidate solutions to propose.
12821291
If not specified, the default value set during initialization is used.</dd>
1283-
<dt><strong><code>acq_func</code></strong> :&ensp;<code>Callable</code>, default <code>ACQ_FUNCS['UCB']</code></dt>
1292+
<dt><strong><code>acq_func</code></strong> :&ensp;<code>Callable</code>, default <code>ACQ_FUNCS['LCB']</code></dt>
12841293
<dd>
12851294
<p>Acquisition function used to guide the selection of candidate solutions.
1286-
By default, upper confidence bound (i.e. <code>mean - kappa * std</code> where <code>mean</code>
1295+
By default, lower confidence bound (i.e. <code>mean - kappa * std</code> where <code>mean</code>
12871296
and <code>std</code> are surrogate models' predicted results).</p>
12881297
<div class="admonition tip">
12891298
<p class="admonition-title">Tip</p>
1290-
<p><a href="https://github.com/search?q=repo%3Asambo-optimization%2Fsambo%20ACQ_FUNCS&amp;type=code">See the source</a> for how <code>ACQ_FUNCS['UCB']</code> is implemeted.
1299+
<p><a href="https://github.com/search?q=repo%3Asambo-optimization%2Fsambo%20ACQ_FUNCS&amp;type=code">See the source</a> for how <code>ACQ_FUNCS['LCB']</code> is implemeted.
12911300
The passed parameters are open to extension to accommodate
12921301
alternative acquisition functions.</p>
12931302
</div>
12941303
</dd>
12951304
<dt><strong><code>kappa</code></strong> :&ensp;<code>float</code> or <code>list[float]</code>, default <code>0</code></dt>
12961305
<dd>
1297-
<p>The upper/lower-confidence-bound parameter, used by <code>acq_func</code>, that
1306+
<p>The lower-confidence-bound parameter, used by <code>acq_func</code>, that
12981307
balances exploration (&lt;0) vs exploitation (&gt;0).</p>
12991308
<p>Can also be an array of values to use sequentially for <code>n_cadidates</code>.</p>
13001309
</dd>
@@ -1321,7 +1330,7 @@ <h2 id="examples">Examples</h2>
13211330
<details class="source">
13221331
<summary>
13231332
<span>Expand source code</span>
1324-
<a href="https://github.com/sambo-optimization/sambo/blob/ec7433286915d71bb7bb8f4e38758eca5c7171f6/sambo/_smbo.py#L422-L519" class="git-link" target="_blank">Browse git</a>
1333+
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_smbo.py#L428-L525" class="git-link" target="_blank">Browse git</a>
13251334
</summary>
13261335
<pre><code class="python">def run(self, *,
13271336
max_iter: Optional[int] = None,
@@ -1459,7 +1468,7 @@ <h2 id="examples">Examples</h2>
14591468
<details class="source">
14601469
<summary>
14611470
<span>Expand source code</span>
1462-
<a href="https://github.com/sambo-optimization/sambo/blob/ec7433286915d71bb7bb8f4e38758eca5c7171f6/sambo/_smbo.py#L370-L420" class="git-link" target="_blank">Browse git</a>
1471+
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_smbo.py#L376-L426" class="git-link" target="_blank">Browse git</a>
14631472
</summary>
14641473
<pre><code class="python">def tell(self, y: float | list[float],
14651474
x: Optional[float | tuple[float] | list[tuple[float]]] = None):
@@ -1546,7 +1555,7 @@ <h2 id="examples">Examples</h2>
15461555
<details class="source">
15471556
<summary>
15481557
<span>Expand source code</span>
1549-
<a href="https://github.com/sambo-optimization/sambo/blob/ec7433286915d71bb7bb8f4e38758eca5c7171f6/sambo/_smbo.py#L521-L549" class="git-link" target="_blank">Browse git</a>
1558+
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_smbo.py#L527-L555" class="git-link" target="_blank">Browse git</a>
15501559
</summary>
15511560
<pre><code class="python">def top_k(self, k: int = 1):
15521561
&#34;&#34;&#34;
@@ -1610,14 +1619,15 @@ <h2 id="examples">Examples</h2>
16101619
<details class="source">
16111620
<summary>
16121621
<span>Expand source code</span>
1613-
<a href="https://github.com/sambo-optimization/sambo/blob/ec7433286915d71bb7bb8f4e38758eca5c7171f6/sambo/_estimators.py#L112-L199" class="git-link" target="_blank">Browse git</a>
1622+
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/_estimators.py#L112-L200" class="git-link" target="_blank">Browse git</a>
16141623
</summary>
16151624
<pre><code class="python">class SamboSearchCV(BaseSearchCV):
16161625
&#34;&#34;&#34;
16171626
SAMBO hyper-parameter search with cross-validation that can be
16181627
used to **optimize hyperparameters of machine learning estimator pipelines**
16191628
like those of scikit-learn.
1620-
Similar to `GridSearchCV` from scikit-learn,
1629+
**Similar to `BayesSearchCV`** from _scikit-optimize_ or
1630+
`GridSearchCV` from _scikit-learn_,
16211631
but hopefully **much faster for large parameter spaces**.
16221632

16231633
Parameters
@@ -1704,7 +1714,8 @@ <h2 id="examples">Examples</h2>
17041714
<div class="desc"><p>SAMBO hyper-parameter search with cross-validation that can be
17051715
used to <strong>optimize hyperparameters of machine learning estimator pipelines</strong>
17061716
like those of scikit-learn.
1707-
Similar to <code>GridSearchCV</code> from scikit-learn,
1717+
<strong>Similar to <code>BayesSearchCV</code></strong> from <em>scikit-optimize</em> or
1718+
<code>GridSearchCV</code> from <em>scikit-learn</em>,
17081719
but hopefully <strong>much faster for large parameter spaces</strong>.</p>
17091720
<h2 id="parameters">Parameters</h2>
17101721
<dl>

doc/sambo/plot.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
7171
<details class="source">
7272
<summary>
7373
<span>Expand source code</span>
74-
<a href="https://github.com/sambo-optimization/sambo/blob/ec7433286915d71bb7bb8f4e38758eca5c7171f6/sambo/plot.py#L38-L103" class="git-link" target="_blank">Browse git</a>
74+
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/plot.py#L38-L103" class="git-link" target="_blank">Browse git</a>
7575
</summary>
7676
<pre><code class="python">def plot_convergence(
7777
*results: OptimizeResult | tuple[str, OptimizeResult],
@@ -168,7 +168,7 @@ <h2 id="example">Example</h2>
168168
<details class="source">
169169
<summary>
170170
<span>Expand source code</span>
171-
<a href="https://github.com/sambo-optimization/sambo/blob/ec7433286915d71bb7bb8f4e38758eca5c7171f6/sambo/plot.py#L656-L757" class="git-link" target="_blank">Browse git</a>
171+
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/plot.py#L656-L757" class="git-link" target="_blank">Browse git</a>
172172
</summary>
173173
<pre><code class="python">def plot_evaluations(
174174
result: OptimizeResult,
@@ -323,7 +323,7 @@ <h2 id="example">Example</h2>
323323
<details class="source">
324324
<summary>
325325
<span>Expand source code</span>
326-
<a href="https://github.com/sambo-optimization/sambo/blob/ec7433286915d71bb7bb8f4e38758eca5c7171f6/sambo/plot.py#L471-L653" class="git-link" target="_blank">Browse git</a>
326+
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/plot.py#L471-L653" class="git-link" target="_blank">Browse git</a>
327327
</summary>
328328
<pre><code class="python">def plot_objective(
329329
result: OptimizeResult,
@@ -589,7 +589,7 @@ <h2 id="example">Example</h2>
589589
<details class="source">
590590
<summary>
591591
<span>Expand source code</span>
592-
<a href="https://github.com/sambo-optimization/sambo/blob/ec7433286915d71bb7bb8f4e38758eca5c7171f6/sambo/plot.py#L128-L203" class="git-link" target="_blank">Browse git</a>
592+
<a href="https://github.com/sambo-optimization/sambo/blob/a85f8fb9452ba14752943ce1587436f8394f6174/sambo/plot.py#L128-L203" class="git-link" target="_blank">Browse git</a>
593593
</summary>
594594
<pre><code class="python">def plot_regret(
595595
*results: OptimizeResult | tuple[str, OptimizeResult],

0 commit comments

Comments
 (0)