@@ -21,27 +21,32 @@ class BalancingLearner(BaseLearner):
2121
2222 Parameters
2323 ----------
24- learners : sequence of BaseLearner
24+ learners : sequence of ` BaseLearner`
2525 The learners from which to choose. These must all have the same type.
2626 cdims : sequence of dicts, or (keys, iterable of values), optional
2727 Constant dimensions; the parameters that label the learners. Used
2828 in `plot`.
2929 Example inputs that all give identical results:
30+
3031 - sequence of dicts:
32+
3133 >>> cdims = [{'A': True, 'B': 0},
3234 ... {'A': True, 'B': 1},
3335 ... {'A': False, 'B': 0},
3436 ... {'A': False, 'B': 1}]`
37+
3538 - tuple with (keys, iterable of values):
39+
3640 >>> cdims = (['A', 'B'], itertools.product([True, False], [0, 1]))
3741 >>> cdims = (['A', 'B'], [(True, 0), (True, 1),
3842 ... (False, 0), (False, 1)])
43+
3944 strategy : 'loss_improvements' (default), 'loss', or 'npoints'
40- The points that the ' BalancingLearner' choses can be either based on:
45+ The points that the ` BalancingLearner` choses can be either based on:
4146 the best 'loss_improvements', the smallest total 'loss' of the
4247 child learners, or the number of points per learner, using 'npoints'.
4348 One can dynamically change the strategy while the simulation is
44- running by changing the ' learner.strategy' attribute.
49+ running by changing the `` learner.strategy`` attribute.
4550
4651 Notes
4752 -----
@@ -50,7 +55,7 @@ class BalancingLearner(BaseLearner):
5055 compared*. For the moment we enforce this restriction by requiring that
5156 all learners are the same type but (depending on the internals of the
5257 learner) it may be that the loss cannot be compared *even between learners
53- of the same type*. In this case the BalancingLearner will behave in an
58+ of the same type*. In this case the ` BalancingLearner` will behave in an
5459 undefined way.
5560 """
5661
@@ -183,28 +188,34 @@ def plot(self, cdims=None, plotter=None, dynamic=True):
183188 cdims : sequence of dicts, or (keys, iterable of values), optional
184189 Constant dimensions; the parameters that label the learners.
185190 Example inputs that all give identical results:
191+
186192 - sequence of dicts:
193+
187194 >>> cdims = [{'A': True, 'B': 0},
188195 ... {'A': True, 'B': 1},
189196 ... {'A': False, 'B': 0},
190197 ... {'A': False, 'B': 1}]`
198+
191199 - tuple with (keys, iterable of values):
200+
192201 >>> cdims = (['A', 'B'], itertools.product([True, False], [0, 1]))
193202 >>> cdims = (['A', 'B'], [(True, 0), (True, 1),
194203 ... (False, 0), (False, 1)])
204+
195205 plotter : callable, optional
196206 A function that takes the learner as a argument and returns a
197- holoviews object. By default learner.plot() will be called.
207+ holoviews object. By default `` learner.plot()`` will be called.
198208 dynamic : bool, default True
199- Return a holoviews.DynamicMap if True, else a holoviews.HoloMap.
200- The DynamicMap is rendered as the sliders change and can therefore
201- not be exported to html. The HoloMap does not have this problem.
209+ Return a `holoviews.core.DynamicMap` if True, else a
210+ `holoviews.core.HoloMap`. The `~holoviews.core.DynamicMap` is
211+ rendered as the sliders change and can therefore not be exported
212+ to html. The `~holoviews.core.HoloMap` does not have this problem.
202213
203214 Returns
204215 -------
205- dm : holoviews.DynamicMap object (default) or holoviews.HoloMap object
206- A DynamicMap (dynamic=True) or HoloMap (dynamic=False) with
207- sliders that are defined by ' cdims' .
216+ dm : ` holoviews.core. DynamicMap` (default) or ` holoviews.core. HoloMap`
217+ A ` DynamicMap` (dynamic=True) or ` HoloMap` (dynamic=False) with
218+ sliders that are defined by ` cdims` .
208219 """
209220 hv = ensure_holoviews ()
210221 cdims = cdims or self ._cdims_default
@@ -248,13 +259,13 @@ def remove_unfinished(self):
248259 def from_product (cls , f , learner_type , learner_kwargs , combos ):
249260 """Create a `BalancingLearner` with learners of all combinations of
250261 named variables’ values. The `cdims` will be set correctly, so calling
251- `learner.plot` will be a `holoviews.HoloMap` with the correct labels.
262+ `learner.plot` will be a `holoviews.core. HoloMap` with the correct labels.
252263
253264 Parameters
254265 ----------
255266 f : callable
256267 Function to learn, must take arguments provided in in `combos`.
257- learner_type : BaseLearner
268+ learner_type : ` BaseLearner`
258269 The learner that should wrap the function. For example `Learner1D`.
259270 learner_kwargs : dict
260271 Keyword argument for the `learner_type`. For example `dict(bounds=[0, 1])`.
0 commit comments