...
|
...
|
@@ -335,13 +335,13 @@ class BalancingLearner(BaseLearner):
|
335
|
335
|
-------
|
336
|
336
|
>>> def combo_fname(learner):
|
337
|
337
|
... val = learner.function.keywords # because functools.partial
|
338
|
|
- ... fname = '__'.join([f'{k}_{v}.pickle' for k, v in val])
|
|
338
|
+ ... fname = '__'.join([f'{k}_{v}.pickle' for k, v in val.items()])
|
339
|
339
|
... return 'data_folder/' + fname
|
340
|
340
|
>>>
|
341
|
341
|
>>> def f(x, a, b): return a * x**2 + b
|
342
|
342
|
>>>
|
343
|
343
|
>>> learners = [Learner1D(functools.partial(f, **combo), (-1, 1))
|
344
|
|
- ... for combo in adaptive.utils.named_product(a=[1, 2], b=[1]]
|
|
344
|
+ ... for combo in adaptive.utils.named_product(a=[1, 2], b=[1])]
|
345
|
345
|
>>>
|
346
|
346
|
>>> learner = BalancingLearner(learners)
|
347
|
347
|
>>> # Run the learner
|