snowflake.ml.modeling.metrics.mean_absolute_error

snowflake.ml.modeling.metrics.mean_absolute_error(*, df: DataFrame, y_true_col_names: str | list[str], y_pred_col_names: str | list[str], sample_weight_col_name: str | None = None, multioutput: str | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | _NestedSequence[complex | bytes | str] = 'uniform_average') float | ndarray[tuple[Any, ...], dtype[float64]]

Mean absolute error regression loss.

Parameters:
  • df – snowpark.DataFrame Input dataframe.

  • y_true_col_names – string or list of strings Column name(s) representing actual values.

  • y_pred_col_names – string or list of strings Column name(s) representing predicted values.

  • sample_weight_col_name – string, default=None Column name representing sample weights.

  • multioutput

    {‘raw_values’, ‘uniform_average’} or array-like of shape (n_outputs,), default=’uniform_average’ Defines aggregating of multiple output values. Array-like value defines weights used to average errors. ‘raw_values’:

    Returns a full set of errors in case of multioutput input.

    ’uniform_average’:

    Errors of all outputs are averaged with uniform weight.

Returns:

float or ndarray of floats

If multioutput is ‘raw_values’, then mean absolute error is returned for each output separately. If multioutput is ‘uniform_average’ or an ndarray of weights, then the weighted average of all output errors is returned.

MAE output is non-negative floating point. The best value is 0.0.

Return type:

loss