skfp.metrics.multioutput_mean_squared_error#

skfp.metrics.multioutput_mean_squared_error(y_true: ndarray, y_pred: ndarray, *args, **kwargs) float#

Mean squared error (MSE) for multioutput problems.

Returns the average value over all tasks. Missing values in target labels are ignored. Also supports single-task evaluation.

Any additional arguments are passed to the underlying mean_squared_error function, see scikit-learn documentation for more information.

Parameters:
  • y_true (array-like of shape (n_samples,) or (n_samples, n_outputs)) – Ground truth (correct) target values.

  • y_pred (array-like of shape (n_samples,) or (n_samples, n_outputs)) – Estimated target values.

  • *args – Any additional parameters for the underlying scikit-learn metric function.

  • **kwargs – Any additional parameters for the underlying scikit-learn metric function.

Returns:

score – Average MSE value over all tasks.

Return type:

float

Examples

>>> import numpy as np
>>> from skfp.metrics import multioutput_mean_squared_error
>>> y_true = [[0.5, 1], [-1, 1], [7, -6]]
>>> y_pred = [[0, 2], [-1, 2], [8, -5]]
>>> multioutput_mean_squared_error(y_true, y_pred)
0.708...
>>> y_true = [[0.5, 1], [-1, 1], [np.nan, 10], [-10, np.nan]]
>>> y_pred = [[0, 2], [-1, 2], [-3, 8], [-10, 5]]
>>> multioutput_mean_squared_error(y_true, y_pred)
1.041...