pwtools.rbf.hyperopt.fit_opt¶
- pwtools.rbf.hyperopt.fit_opt(points, values, method='de', what='pr', cv={'n_repeats': 1, 'n_splits': 5}, cv_kwds=None, opt_kwds={}, rbf_kwds={})[source]¶
Optimize
Rbf
’s hyper-parameter \(p\) or both \((p,r)\).Use a cross validation error metric or the direct fit error if cv is None. Uses
FitError
.Note: While we do have some defaults for initial guess or bounds, depending on the optimizer, you are strongly advised to set your own in opt_kwds.
- Parameters:
points – see
Rbf
values – see
Rbf
method (str) –
’fmin’:
scipy.optimize.fmin()
’brute’:
scipy.optimize.brute()
what (str) –
‘p’ : optimize only p, set fixed r in rbf_kwds in this case, else we’ll use
Rbf
’s default)’pr’ : optimize p and r
cv – see
FitError
rbf_kwds (dict) – see
FitError
opt_kwds (dict) – kwds for the optimizer (see method)
rbf_kwds – Constant params for
Rbf
- Returns:
rbfi – Rbf instance initialized with points, values and found optimal p (and r).
- Return type:
Rbf