-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
How to pass args to skopt, like n_jobs for multiprocessing? #276
-
Hi,
How can we pass arguments to skopt
when using method='skopt'
with backtest.optimize
? Would like to update n_jobs
because the default is 1.
Tried passing it as a keyword arg, but does not work: bt.optimize(p1=range(20, 50, 10), p2=range(50, 100, 10), maximize='Profit Factor', constraint=lambda param: param.p1 < param.p2, method='skopt', n_jobs=15)
n_jobs int, default: 1
The number of jobs to run in parallel for fit and predict. If -1, then the number of jobs is set to the number of cores.
Thank you,
Beta Was this translation helpful? Give feedback.
All reactions
Tried passing it as a keyword arg, but does not work
It doesn't work if it's not implemented in the source.
backtesting.py/backtesting/backtesting.py
Lines 1247 to 1252 in 73e1534
Passing n_jobs != 1
won't help you; n_jobs=
in scikit-optimize is only used for building the hyperspace landscape estimators, not for running the comparably likely more expensive ob...
Replies: 1 comment 1 reply
-
Tried passing it as a keyword arg, but does not work
It doesn't work if it's not implemented in the source.
backtesting.py/backtesting/backtesting.py
Lines 1247 to 1252 in 73e1534
Passing n_jobs != 1
won't help you; n_jobs=
in scikit-optimize is only used for building the hyperspace landscape estimators, not for running the comparably likely more expensive objective function. Scikit-optimize does iterative model-based optimization, and you get your time back in terms of fewer and more intelligent hyperspace point evaluations.
Don't just believe me; try it for yourself:
backtesting.py/backtesting/backtesting.py
Line 1440 in 73e1534
Beta Was this translation helpful? Give feedback.
All reactions
-
n_jobs= in scikit-optimize is only used for building the hyperspace landscape estimators, not for running the comparably likely more expensive objective function.
Oo did not know that. I ran a quick preliminary test earlier, but only looked at number of CPUs used vs. If it actually sped up the computations. I didn't see it in their documentation either. Thanks for the help again!
Beta Was this translation helpful? Give feedback.