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: DataDrivenModel

Class for models of stationary problems that use regressors for prediction.

This class implements a Model that 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 fit and predict methods 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.

  • parametersParameters of 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 with fit, transform and inverse_transform methods 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 with fit, transform and inverse_transform methods 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_functionalOperator mapping a given solution to the model output. In many applications, this will be a Functional, i.e. an Operator mapping to scalars. This is not required, however.

  • products – A dict of inner product Operators defined on the discrete space the problem is posed on. For each product with key 'x' a corresponding attribute x_product, as well as a norm method x_norm is 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. If error_estimator is not None, an estimate_error(U, mu) method is added to the model which will call error_estimator.estimate_error(U, mu, self).

  • visualizer – A visualizer for the problem. This can be any object with a visualize(U, m, ...) method. If visualizer is not None, a visualize(U, *args, **kwargs) method is added to the model which forwards its arguments to the visualizer’s visualize method.

  • 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.Model

Class for models of stationary problems that use regressors for prediction.

This class implements a Model that uses a regressor for solution or output approximation.

Parameters:
  • regressor – Regressor with fit and predict methods 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.

  • parametersParameters of 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 with fit, transform and inverse_transform methods 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 with fit, transform and inverse_transform methods 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_functionalOperator mapping a given solution to the model output. In many applications, this will be a Functional, i.e. an Operator mapping to scalars. This is not required, however.

  • products – A dict of inner product Operators defined on the discrete space the problem is posed on. For each product with key 'x' a corresponding attribute x_product, as well as a norm method x_norm is 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. If error_estimator is not None, an estimate_error(U, mu) method is added to the model which will call error_estimator.estimate_error(U, mu, self).

  • visualizer – A visualizer for the problem. This can be any object with a visualize(U, m, ...) method. If visualizer is not None, a visualize(U, *args, **kwargs) method is added to the model which forwards its arguments to the visualizer’s visualize method.

  • name – Name of the model.