pymor.models.data_driven¶
Module Contents¶
- class pymor.models.data_driven.DataDrivenInstationaryModel(T, nt, regressor, target_quantity='solution', parameters={}, dim_solution_space=None, input_scaler=None, output_scaler=None, time_vectorized=False, output_functional=None, products=None, error_estimator=None, visualizer=None, name='DataDrivenModel')[source]¶
Bases:
DataDrivenModelClass for models of stationary problems that use regressors for prediction.
This class implements a
Modelthat uses an regressor for solution or output approximation.- Parameters:
T – In the instationary case, determines the final time until which to solve.
nt – Number of time steps.
regressor – Regressor with
fitandpredictmethods similar to scikit-learn regressors that is used for prediction in_compute.target_quantity – Either
'solution'or'output', determines which quantity is predicted by the regressor.parameters –
Parametersof the reduced order model (the same as used in the full-order model).dim_solution_space – Dimension of the solution space in case that
target_quantity='solution'.input_scaler – If not
None, a scaler object withfit,transformandinverse_transformmethods similar to the scikit-learn interface can be used to scale the parameters before passing them to the regressor.output_scaler – If not
None, a scaler object withfit,transformandinverse_transformmethods similar to the scikit-learn interface can be used to scale the outputs (reduced coeffcients or output quantities) before passing them to the regressor.time_vectorized – In the instationary case, determines whether to predict the whole time trajectory at once (time-vectorized version; output of the regressor is typically very high-dimensional in this case) or if the result for a single point in time is approximated (time serves as an additional input to the regressor).
output_functional –
Operatormapping a given solution to the model output. In many applications, this will be aFunctional, i.e. anOperatormapping to scalars. This is not required, however.products – A dict of inner product
Operatorsdefined on the discrete space the problem is posed on. For each product with key'x'a corresponding attributex_product, as well as a norm methodx_normis added to the model.error_estimator – An error estimator for the problem. This can be any object with an
estimate_error(U, mu, m)method. Iferror_estimatoris notNone, anestimate_error(U, mu)method is added to the model which will callerror_estimator.estimate_error(U, mu, self).visualizer – A visualizer for the problem. This can be any object with a
visualize(U, m, ...)method. Ifvisualizeris notNone, avisualize(U, *args, **kwargs)method is added to the model which forwards its arguments to the visualizer’svisualizemethod.name – Name of the model.
- class pymor.models.data_driven.DataDrivenModel(regressor, target_quantity='solution', parameters={}, dim_solution_space=None, input_scaler=None, output_scaler=None, output_functional=None, products=None, error_estimator=None, visualizer=None, name='DataDrivenModel')[source]¶
Bases:
pymor.models.interface.ModelClass for models of stationary problems that use regressors for prediction.
This class implements a
Modelthat uses a regressor for solution or output approximation.- Parameters:
regressor – Regressor with
fitandpredictmethods similar to scikit-learn regressors that is used for prediction in_compute.target_quantity – Either
'solution'or'output', determines which quantity is predicted by the regressor.parameters –
Parametersof the reduced order model (the same as used in the full-order model).dim_solution_space – Dimension of the solution space in case that
target_quantity='solution'.input_scaler – If not
None, a scaler object withfit,transformandinverse_transformmethods similar to the scikit-learn interface can be used to scale the parameters before passing them to the regressor.output_scaler – If not
None, a scaler object withfit,transformandinverse_transformmethods similar to the scikit-learn interface can be used to scale the outputs (reduced coeffcients or output quantities) before passing them to the regressor.output_functional –
Operatormapping a given solution to the model output. In many applications, this will be aFunctional, i.e. anOperatormapping to scalars. This is not required, however.products – A dict of inner product
Operatorsdefined on the discrete space the problem is posed on. For each product with key'x'a corresponding attributex_product, as well as a norm methodx_normis added to the model.error_estimator – An error estimator for the problem. This can be any object with an
estimate_error(U, mu, m)method. Iferror_estimatoris notNone, anestimate_error(U, mu)method is added to the model which will callerror_estimator.estimate_error(U, mu, self).visualizer – A visualizer for the problem. This can be any object with a
visualize(U, m, ...)method. Ifvisualizeris notNone, avisualize(U, *args, **kwargs)method is added to the model which forwards its arguments to the visualizer’svisualizemethod.name – Name of the model.