@@ -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 """
@@ -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 """
@@ -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- #: "UCB" for upper confidence bound (`mean - kappa * std`).
812+ #: `"LCB"` — **lower confidence bound** (an inverse analog of "UCB")
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's `predict()` method to implement `return_std=` behavior.
817818 #: All built-in estimators (`"gp"`, `"et"`, `"gb"`) do so.
818819 ACQ_FUNCS: dict = {
819- 'UCB ': _UCB ,
820+ 'LCB ': _LCB ,
820821 }
821822
822823 def ask(
823824 self,
824825 n_candidates: Optional[int] = None,
825826 *,
826- acq_func: Optional[Callable] = ACQ_FUNCS['UCB '],
827+ acq_func: Optional[Callable] = ACQ_FUNCS['LCB '],
827828 kappa: float | list[float] = 0,
828829 ) -> np.ndarray:
829830 """
@@ -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['UCB ']
840+ acq_func : Callable, default ACQ_FUNCS['LCB ']
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' predicted results).
843844
844845 .. tip::
845- [See the source][_ghs] for how `ACQ_FUNCS['UCB ']` is implemeted.
846+ [See the source][_ghs] for how `ACQ_FUNCS['LCB ']` 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&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 (<0) vs exploitation (>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.
11641170Currently 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 = <function _UCB >,< 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 = <function _LCB >,< 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['UCB '],
1206+ acq_func: Optional[Callable] = ACQ_FUNCS['LCB '],
11981207 kappa: float | list[float] = 0,
11991208) -> np.ndarray:
12001209 """
@@ -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['UCB ']
1219+ acq_func : Callable, default ACQ_FUNCS['LCB ']
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' predicted results).
12141223
12151224 .. tip::
1216- [See the source][_ghs] for how `ACQ_FUNCS['UCB ']` is implemeted.
1225+ [See the source][_ghs] for how `ACQ_FUNCS['LCB ']` 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&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 (<0) vs exploitation (>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 > : < code > int</ code > , optional</ dt >
12811290< dd > Number of candidate solutions to propose.
12821291If not specified, the default value set during initialization is used.</ dd >
1283- < dt > < strong > < code > acq_func</ code > </ strong > : < code > Callable</ code > , default < code > ACQ_FUNCS['UCB ']</ code > </ dt >
1292+ < dt > < strong > < code > acq_func</ code > </ strong > : < 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 >
12871296and < 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&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&type=code "> See the source</ a > for how < code > ACQ_FUNCS['LCB ']</ code > is implemeted.
12911300The passed parameters are open to extension to accommodate
12921301alternative acquisition functions.</ p >
12931302</ div >
12941303</ dd >
12951304< dt > < strong > < code > kappa</ code > </ strong > : < 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
12981307balances exploration (<0) vs exploitation (>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 """
@@ -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 """
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
17051715used to < strong > optimize hyperparameters of machine learning estimator pipelines</ strong >
17061716like 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 > ,
17081719but hopefully < strong > much faster for large parameter spaces</ strong > .</ p >
17091720< h2 id ="parameters "> Parameters</ h2 >
17101721< dl >
0 commit comments