fit()#
- ROM.fit(states, lhs=None, inputs=None, fit_transformer: bool = True, fit_basis: bool = True)[source]#
Calibrate the model to training data.
- Parameters:
- stateslist of s (n, k_i) ndarrays
State snapshots in the original state space. Each array
states[i]
is data corresponding to a different trajectory; each columnstates[i][:, j]
is one snapshot. If there is only one trajectory of training data (s = 1),states
may be an (n, k) ndarray. In this case, it is assumed thatlhs
andinputs
(if given) are arrays, not a sequence of arrays.- 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
, calibrate the high-to-low dimensional mapping using thestates
. IfFalse
, assume the basis is already calibrated.
- Returns:
- self