multioutput_mean_absolute_error#
- skfp.metrics.multioutput_mean_absolute_error(y_true: ndarray | list, y_pred: ndarray | list, *args, **kwargs) float #
Mean absolute error (MAE) 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_absolute_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 MAE value over all tasks.
- Return type:
float
Examples
>>> import numpy as np >>> from skfp.metrics import multioutput_mean_absolute_error >>> y_true = [[0.5, 1], [-1, 1], [7, -6]] >>> y_pred = [[0, 2], [-1, 2], [8, -5]] >>> multioutput_mean_absolute_error(y_true, y_pred) 0.75 >>> 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_absolute_error(y_true, y_pred) 0.75