fit()#
- ParametricROM.fit(parameters, states, lhs=None, inputs=None, fit_transformer: bool = True, fit_basis: bool = True)[source]#
Calibrate the model to training data.
- Parameters:
- parameterslist of s (floats or (p,) ndarrays)
Parameter values for which training data are available.
- stateslist of s (n, k_i) ndarrays
State snapshots in the original state space. Each array
states[i]
is the data corresponding to parameter valueparameters[i]
; each columnstates[i][:, j]
is one snapshot.- lhslist of s (n, k_i) ndarrays or None
Left-hand side regression data. Each array
lhs[i]
is the data corresponding to parameter valueparameters[i]
; each columnlhs[i][:, j]
corresponds to the snapshotstates[i][:, j]
.If the model is time continuous, these are the time derivatives of the state snapshots.
If the model is fully discrete, these are the “next states” corresponding to the state snapshots.
If
None
, these are estimated usingddt_estimator
(time continuous) or extracted fromstates
(fully discrete).- inputslist of s (m, k_i) ndarrays or None
Input training data. Each array
inputs[i]
is the data corresponding to parameter valueparameters[i]
; each columninputs[i][:, j]
corresponds to the snapshotstates[:, j]
. May be a two-dimensional array if \(m=1\) (scalar input). Only required if one or more model operators depend on inputs.- fit_transformerbool
If
True
(default), calibrate the preprocessing transformation using thestates
. IfFalse
, assume the transformer is already calibrated.- fit_basisbool
If
True
(default), calibrate the high-to-low dimensional mapping using thestates
. IfFalse
, assume the basis is already calibrated.
- Returns:
- self