pysindy.deeptime package
Submodules
pysindy.deeptime.deeptime module
Deeptime wrapper interface for PySINDy.
- class pysindy.deeptime.deeptime.SINDyEstimator(optimizer=None, feature_library=None, differentiation_method=None, feature_names=None, t_default=1, discrete_time=False)[source]
Bases:
SINDy
Implementation of SINDy conforming to the API of a Deeptime Estimator.
- Parameters:
optimizer (optimizer object, optional) – Optimization method used to fit the SINDy model. This must be an object extending
pysindy.optimizers.BaseOptimizer
. Default is sequentially thresholded least squares with a threshold of 0.1.feature_library (feature library object, optional) – Feature library object used to specify candidate right-hand side features. This must be an object extending the
pysindy.feature_library.base.BaseFeatureLibrary
. Default is polynomial features of degree 2.differentiation_method (differentiation object, optional) – Method for differentiating the data. This must be an object extending the
pysindy.differentiation_methods.base.BaseDifferentiation
class. Default is centered difference.feature_names (list of string, length n_input_features, optional) – Names for the input features (e.g.
['x', 'y', 'z']
). If None, will use['x0', 'x1', ...]
.t_default (float, optional (default 1)) – Default value for the time step.
discrete_time (boolean, optional (default False)) – If True, dynamical system is treated as a map. Rather than predicting derivatives, the right hand side functions step the system forward by one time step. If False, dynamical system is assumed to be a flow (right-hand side functions predict continuous time derivatives).
- Attributes:
model (sklearn.multioutput.MultiOutputRegressor object) – The fitted SINDy model.
n_input_features_ (int) – The total number of input features.
n_output_features_ (int) – The total number of output features. This number is a function of
self.n_input_features
and the feature library being used.
- fit(x, **kwargs)[source]
Fit the SINDyEstimator to data, learning a dynamical systems model for the data.
- Parameters:
x (array-like or list of array-like, shape (n_samples, n_input_features)) – Training data. If training data contains multiple trajectories, x should be a list containing data for each trajectory. Individual trajectories may contain different numbers of samples.
**kwargs (dict, optional) – Optional keyword arguments to pass to
fit
method.
- Returns:
self
- Return type:
fitted
SINDyEstimator
instance
- fetch_model()[source]
Yields the estimated model. Can be none if
fit
was not called.- Returns:
model – The estimated SINDy model or none
- Return type:
SINDyModel
or None
- property has_model
Property reporting whether this estimator contains an estimated model. This assumes that the model is initialized with
None
otherwise.- Type:
bool
- set_fit_request(*, x: bool | None | str = '$UNCHANGED$') SINDyEstimator
Request metadata passed to the
fit
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed tofit
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it tofit
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.New in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.- Parameters:
x (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x
parameter infit
.- Returns:
self – The updated object.
- Return type:
object
- set_predict_request(*, u: bool | None | str = '$UNCHANGED$', x: bool | None | str = '$UNCHANGED$') SINDyEstimator
Request metadata passed to the
predict
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed topredict
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it topredict
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.New in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.- Parameters:
u (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
u
parameter inpredict
.x (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x
parameter inpredict
.
- Returns:
self – The updated object.
- Return type:
object
- set_score_request(*, metric: bool | None | str = '$UNCHANGED$', t: bool | None | str = '$UNCHANGED$', u: bool | None | str = '$UNCHANGED$', x: bool | None | str = '$UNCHANGED$', x_dot: bool | None | str = '$UNCHANGED$') SINDyEstimator
Request metadata passed to the
score
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed toscore
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it toscore
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.New in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.- Parameters:
metric (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
metric
parameter inscore
.t (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
t
parameter inscore
.u (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
u
parameter inscore
.x (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x
parameter inscore
.x_dot (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x_dot
parameter inscore
.
- Returns:
self – The updated object.
- Return type:
object
- class pysindy.deeptime.deeptime.SINDyModel(feature_library, optimizer, feature_names=None, t_default=1, discrete_time=False, n_control_features_=0)[source]
Bases:
SINDy
Implementation of SINDy conforming to the API of a Deeptime Model.
The model is represented as a Scikit-learn pipeline object with three steps: 1. Map the raw input data to nonlinear features according to the selected
feature_library
2. Reshape the data from input shape to an optimization problem 3. Multiply the nonlinear features with a coefficient matrix encapuslated inoptimizer
.This class expects the feature library and optimizer to already be fit with a
SINDyEstimator
. It is best to instantiate aSINDyModel
object via theSINDyEstimator.fetch_model
rather than calling theSINDyModel
constructor directly.- Parameters:
optimizer (optimizer object) – Optimization method used to fit the SINDy model. This must be an (already fit) object extending
pysindy.optimizers.BaseOptimizer
.feature_library (feature library object) – Feature library object used to specify candidate right-hand side features. This must be an (already fit) object extending
pysindy.feature_library.BaseFeatureLibrary
.differentiation_method (differentiation object) – Method for differentiating the data. This must be an object extending
pysindy.differentiation_methods.BaseDifferentiation
. Default is centered difference.feature_names (list of string, length n_input_features, optional) – Names for the input features (e.g.
['x', 'y', 'z']
). If None, will use['x0', 'x1', ...]
.t_default (float, optional (default 1)) – Default value for the time step.
discrete_time (boolean, optional (default False)) – If True, dynamical system is treated as a map. Rather than predicting derivatives, the right hand side functions step the system forward by one time step. If False, dynamical system is assumed to be a flow (right-hand side functions predict continuous time derivatives).
- Attributes:
model (sklearn.multioutput.MultiOutputRegressor object) – The fitted SINDy model.
n_input_features_ (int) – The total number of input features.
n_output_features_ (int) – The total number of output features. This number is a function of
self.n_input_features
and the feature library being used.
- copy()[source]
Makes a deep copy of this model.
- Returns:
copy – A new copy of this model.
- Return type:
- set_fit_request(*, t: bool | None | str = '$UNCHANGED$', u: bool | None | str = '$UNCHANGED$', x: bool | None | str = '$UNCHANGED$', x_dot: bool | None | str = '$UNCHANGED$') SINDyModel
Request metadata passed to the
fit
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed tofit
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it tofit
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.New in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.- Parameters:
t (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
t
parameter infit
.u (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
u
parameter infit
.x (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x
parameter infit
.x_dot (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x_dot
parameter infit
.
- Returns:
self – The updated object.
- Return type:
object
- set_predict_request(*, u: bool | None | str = '$UNCHANGED$', x: bool | None | str = '$UNCHANGED$') SINDyModel
Request metadata passed to the
predict
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed topredict
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it topredict
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.New in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.- Parameters:
u (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
u
parameter inpredict
.x (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x
parameter inpredict
.
- Returns:
self – The updated object.
- Return type:
object
- set_score_request(*, metric: bool | None | str = '$UNCHANGED$', t: bool | None | str = '$UNCHANGED$', u: bool | None | str = '$UNCHANGED$', x: bool | None | str = '$UNCHANGED$', x_dot: bool | None | str = '$UNCHANGED$') SINDyModel
Request metadata passed to the
score
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed toscore
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it toscore
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.New in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.- Parameters:
metric (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
metric
parameter inscore
.t (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
t
parameter inscore
.u (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
u
parameter inscore
.x (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x
parameter inscore
.x_dot (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x_dot
parameter inscore
.
- Returns:
self – The updated object.
- Return type:
object
Module contents
- class pysindy.deeptime.SINDyEstimator(optimizer=None, feature_library=None, differentiation_method=None, feature_names=None, t_default=1, discrete_time=False)[source]
Bases:
SINDy
Implementation of SINDy conforming to the API of a Deeptime Estimator.
- Parameters:
optimizer (optimizer object, optional) – Optimization method used to fit the SINDy model. This must be an object extending
pysindy.optimizers.BaseOptimizer
. Default is sequentially thresholded least squares with a threshold of 0.1.feature_library (feature library object, optional) – Feature library object used to specify candidate right-hand side features. This must be an object extending the
pysindy.feature_library.base.BaseFeatureLibrary
. Default is polynomial features of degree 2.differentiation_method (differentiation object, optional) – Method for differentiating the data. This must be an object extending the
pysindy.differentiation_methods.base.BaseDifferentiation
class. Default is centered difference.feature_names (list of string, length n_input_features, optional) – Names for the input features (e.g.
['x', 'y', 'z']
). If None, will use['x0', 'x1', ...]
.t_default (float, optional (default 1)) – Default value for the time step.
discrete_time (boolean, optional (default False)) – If True, dynamical system is treated as a map. Rather than predicting derivatives, the right hand side functions step the system forward by one time step. If False, dynamical system is assumed to be a flow (right-hand side functions predict continuous time derivatives).
- Attributes:
model (sklearn.multioutput.MultiOutputRegressor object) – The fitted SINDy model.
n_input_features_ (int) – The total number of input features.
n_output_features_ (int) – The total number of output features. This number is a function of
self.n_input_features
and the feature library being used.
- fit(x, **kwargs)[source]
Fit the SINDyEstimator to data, learning a dynamical systems model for the data.
- Parameters:
x (array-like or list of array-like, shape (n_samples, n_input_features)) – Training data. If training data contains multiple trajectories, x should be a list containing data for each trajectory. Individual trajectories may contain different numbers of samples.
**kwargs (dict, optional) – Optional keyword arguments to pass to
fit
method.
- Returns:
self
- Return type:
fitted
SINDyEstimator
instance
- fetch_model()[source]
Yields the estimated model. Can be none if
fit
was not called.- Returns:
model – The estimated SINDy model or none
- Return type:
SINDyModel
or None
- property has_model
Property reporting whether this estimator contains an estimated model. This assumes that the model is initialized with
None
otherwise.- Type:
bool
- set_fit_request(*, x: bool | None | str = '$UNCHANGED$') SINDyEstimator
Request metadata passed to the
fit
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed tofit
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it tofit
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.New in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.- Parameters:
x (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x
parameter infit
.- Returns:
self – The updated object.
- Return type:
object
- set_predict_request(*, u: bool | None | str = '$UNCHANGED$', x: bool | None | str = '$UNCHANGED$') SINDyEstimator
Request metadata passed to the
predict
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed topredict
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it topredict
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.New in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.- Parameters:
u (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
u
parameter inpredict
.x (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x
parameter inpredict
.
- Returns:
self – The updated object.
- Return type:
object
- set_score_request(*, metric: bool | None | str = '$UNCHANGED$', t: bool | None | str = '$UNCHANGED$', u: bool | None | str = '$UNCHANGED$', x: bool | None | str = '$UNCHANGED$', x_dot: bool | None | str = '$UNCHANGED$') SINDyEstimator
Request metadata passed to the
score
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed toscore
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it toscore
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.New in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.- Parameters:
metric (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
metric
parameter inscore
.t (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
t
parameter inscore
.u (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
u
parameter inscore
.x (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x
parameter inscore
.x_dot (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x_dot
parameter inscore
.
- Returns:
self – The updated object.
- Return type:
object
- class pysindy.deeptime.SINDyModel(feature_library, optimizer, feature_names=None, t_default=1, discrete_time=False, n_control_features_=0)[source]
Bases:
SINDy
Implementation of SINDy conforming to the API of a Deeptime Model.
The model is represented as a Scikit-learn pipeline object with three steps: 1. Map the raw input data to nonlinear features according to the selected
feature_library
2. Reshape the data from input shape to an optimization problem 3. Multiply the nonlinear features with a coefficient matrix encapuslated inoptimizer
.This class expects the feature library and optimizer to already be fit with a
SINDyEstimator
. It is best to instantiate aSINDyModel
object via theSINDyEstimator.fetch_model
rather than calling theSINDyModel
constructor directly.- Parameters:
optimizer (optimizer object) – Optimization method used to fit the SINDy model. This must be an (already fit) object extending
pysindy.optimizers.BaseOptimizer
.feature_library (feature library object) – Feature library object used to specify candidate right-hand side features. This must be an (already fit) object extending
pysindy.feature_library.BaseFeatureLibrary
.differentiation_method (differentiation object) – Method for differentiating the data. This must be an object extending
pysindy.differentiation_methods.BaseDifferentiation
. Default is centered difference.feature_names (list of string, length n_input_features, optional) – Names for the input features (e.g.
['x', 'y', 'z']
). If None, will use['x0', 'x1', ...]
.t_default (float, optional (default 1)) – Default value for the time step.
discrete_time (boolean, optional (default False)) – If True, dynamical system is treated as a map. Rather than predicting derivatives, the right hand side functions step the system forward by one time step. If False, dynamical system is assumed to be a flow (right-hand side functions predict continuous time derivatives).
- Attributes:
model (sklearn.multioutput.MultiOutputRegressor object) – The fitted SINDy model.
n_input_features_ (int) – The total number of input features.
n_output_features_ (int) – The total number of output features. This number is a function of
self.n_input_features
and the feature library being used.
- copy()[source]
Makes a deep copy of this model.
- Returns:
copy – A new copy of this model.
- Return type:
- set_fit_request(*, t: bool | None | str = '$UNCHANGED$', u: bool | None | str = '$UNCHANGED$', x: bool | None | str = '$UNCHANGED$', x_dot: bool | None | str = '$UNCHANGED$') SINDyModel
Request metadata passed to the
fit
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed tofit
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it tofit
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.New in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.- Parameters:
t (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
t
parameter infit
.u (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
u
parameter infit
.x (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x
parameter infit
.x_dot (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x_dot
parameter infit
.
- Returns:
self – The updated object.
- Return type:
object
- set_predict_request(*, u: bool | None | str = '$UNCHANGED$', x: bool | None | str = '$UNCHANGED$') SINDyModel
Request metadata passed to the
predict
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed topredict
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it topredict
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.New in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.- Parameters:
u (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
u
parameter inpredict
.x (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x
parameter inpredict
.
- Returns:
self – The updated object.
- Return type:
object
- set_score_request(*, metric: bool | None | str = '$UNCHANGED$', t: bool | None | str = '$UNCHANGED$', u: bool | None | str = '$UNCHANGED$', x: bool | None | str = '$UNCHANGED$', x_dot: bool | None | str = '$UNCHANGED$') SINDyModel
Request metadata passed to the
score
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed toscore
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it toscore
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.New in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.- Parameters:
metric (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
metric
parameter inscore
.t (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
t
parameter inscore
.u (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
u
parameter inscore
.x (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x
parameter inscore
.x_dot (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
x_dot
parameter inscore
.
- Returns:
self – The updated object.
- Return type:
object