metrics.mean_absolute_error

mean_absolute_error(y_true: `object`, y_pred: `object`, __namedParameters: `object`)

Mean absolute error regression loss

Usage

import { mean_absolute_error } from 'machinelearn/metrics';
const y_true = [3, -0.5, 2, 7]
const y_pred = [2.5, 0.0, 2, 8]
mean_absolute_error(y_true, y_pred); // 0.5

Defined in metrics/regression.ts:19

Parameters:

ParamTypeDefaultDescription
y_truenumber[] or number[][]nullGround truth (correct) target values.
y_prednumber[] or number[][]nullEstimated target values.
options.sample_weightnumber[]nullSample weights.

Returns:

number