cratepy.optimization.optimizationfunction.RelativeRootMeanSquaredError

class RelativeRootMeanSquaredError[source]

Bases: Loss

Relative Root Mean Squared Error (RRMSE).

loss(self, y, y_ref, type='minimization')[source]

Loss function.

Constructor.

List of Public Methods

loss

Loss function.

Methods

__init__()[source]

Constructor.

loss(y, y_ref, type='minimization')[source]

Loss function.

The Relative Root Mean Squared Error (RRMSE) is defined as

\[\text{RRMSE} (\boldsymbol{y}, \hat{\boldsymbol{y}}) = \sqrt{\dfrac{\dfrac{1}{n} \sum_{i=1}^{n}(y_{i} - \hat{y}_{i})^{2}}{ \sum_{i=1}^{n} \hat{y}_{i}^{2}}}\]

where \(\boldsymbol{y}\) is the vector of predicted values, \(\hat{\boldsymbol{y}}\) is the vector of reference values, and \(n\) is the number of data points.


Parameters:
  • y (tuple[float]) – Values of parametric solution.

  • y_ref (tuple[float]) – Values of reference solution.

  • type ({'minimization', 'maximization'}, default='minimization') – Type of optimization problem. The option ‘maximization’ negates the loss function evaluation.

Returns:

loss – Loss function value.

Return type:

float