pymor.algorithms.ml.base_regressor

Module Contents

class pymor.algorithms.ml.base_regressor.BaseRegressor[source]

Bases: pymor.algorithms.ml.base_estimator.BaseEstimator

Base-class for scikit-learn-style regressors.

This class provides a score function, computing the coefficient of determination. This class cannot be used directly but serves as a base class for other regressors.

Methods

score

Return the coefficient of determination on the data.

score(X, y, sample_weight=None)[source]

Return the coefficient of determination on the data.

Parameters:
  • X – Test samples for which to check the score.

  • y – Ground truth target values associated to the test samples.

  • sample_weight – Vector for weighting the different test samples.

Returns:

The (weighted) coefficient of determination (\(R^2\)-score) on the test samples.