mean_squared_log_error#

skfda.misc.scoring.mean_squared_log_error(y_true, y_pred, *, sample_weight=None, multioutput='uniform_average', squared=True)[source]#
skfda.misc.scoring.mean_squared_log_error(y_true, y_pred, *, sample_weight=None, squared=True, multioutput='uniform_average')
skfda.misc.scoring.mean_squared_log_error(y_true: DataType, y_pred: DataType, *, sample_weight: NDArrayFloat | None = None, multioutput: Literal['uniform_average'] = 'uniform_average', squared: bool = True) float
skfda.misc.scoring.mean_squared_log_error(y_true: DataType, y_pred: DataType, *, sample_weight: NDArrayFloat | None = None, multioutput: Literal['raw_values'], squared: bool = True) DataType

Mean Squared Log Error for FData.

With \(y\_true = (X_1, X_2, ..., X_n)\) being the real values, \(t\_pred = (\hat{X}_1, \hat{X}_2, ..., \hat{X}_n)\) being the estimated and \(sample\_weight = (w_1, w_2, ..., w_n)\), the error is calculated as

\[MSLE(y\_true, y\_pred)(t) = \frac{1}{\sum w_i} \sum_{i=1}^n w_i(\log(1 + X_i(t)) - \log(1 + \hat{X}_i(t)))^2\]

where \(\log\) is the natural logarithm.

For \(y\_true\) and \(y\_pred\) of type FDataGrid, \(MSLE\) is also a FDataGrid object with the same grid points.

If multioutput = ‘raw_values’, the function \(MSLE\) is returned. Otherwise, if multioutput = ‘uniform_average’, the mean of \(MSLE\) is calculated:

\[mean(MSLE) = \frac{1}{V}\int_{D} MSLE(t) dt\]

where \(D\) is the function domain and \(V\) the volume of that domain.

For FDataBasis only ‘uniform_average’ is available.

If \(y\_true\) and \(y\_pred\) are numpy arrays, sklearn function is called.

This function should not be used if for some \(t\) and some \(i\), \(X_i(t) < 0\).

Parameters:
  • y_true – Correct target values.

  • y_pred – Estimated values.

  • sample_weight – Sample weights. By default, uniform weights are taken.

  • multioutput – Defines format of the return.

  • squared – default True. If False, square root is taken.

Returns:

Mean squared log error.

If multioutput = ‘uniform_average’ or \(y\_pred\) and \(y\_true\) are FDataBasis objects, float is returned.

If both \(y\_pred\) and \(y\_true\) are FDataGrid objects and multioutput = ‘raw_values’, FDataGrid is returned.

If both \(y\_pred\) and \(y\_true\) are ndarray and multioutput = ‘raw_values’, ndarray.