pwtools.rbf.hyperopt.FitError¶
- class pwtools.rbf.hyperopt.FitError(points, values, rbf_kwds={}, cv={'n_repeats': 1, 'n_splits': 5}, cv_kwds=None)[source]¶
Bases:
object
Direct or cross-validation (CV) fit error of
Rbf
for a parameter set[p,r]
or just[p]
for r constant.All methods accept a sequence params with either only p (length 1) or p and r (length 2) to build a
Rbf
model and fit it.examples:
r != None -> normal linear solverparams = [1.5, 0] -> no regularization (r=0)params = [1.5, 1e-8] -> with regularizationr = None -> linear least squares solver (only for testing, notrecommended for production)params = [1.5]params = [1.5, None]Use
err_cv()
orerr_direct()
as error metric for param. Or use__call__()
which will call one or the other, depending on params.- __init__(points, values, rbf_kwds={}, cv={'n_repeats': 1, 'n_splits': 5}, cv_kwds=None)[source]¶
- Parameters:
points (see
Rbf
)values (see
Rbf
)rbf_kwds (dict) – for
Rbf(points, values, **rbf_kwds)
cv ({dict,
sklearn.model_selection.BaseCrossValidator
instance) – or anything with that API, None}, optional, if dict then cross-validation parameters forsklearn.model_selection.RepeatedKFold
, ifBaseCrossValidator
-like class then this is used to split data, if None then__call__()
will useerr_direct()
, elseerr_cv()
cv_kwds (deprecated: dict of kwds for default RepeatedKFold)
Methods
cv
(params)Cross validation fit errors.
err_cv
(params)Mean of
cv()
.err_direct
(params)Normal fit error w/o CV.