metrics.mean_squared_log_error

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

Mean squared error regression loss

Usage

import { mean_squared_log_error } from 'machinelearn/metrics';

const y_true = [3, 0.5, 2, 7];
const y_pred = [2.5, 0.0, 2, 8];

console.log(mean_squared_error(y_true, y_pred));
// result: 0.04902636259794235

const y_true1 = [[0.5, 1], [1, 1], [7, 6]];
const y_pred1 = [[0, 2], [1, 2], [8, 5]];

console.log(mean_squared_error(y_true1, y_pred1));
// result: 0.08847352117300034

Defined in metrics/regression.ts:135

Parameters:

ParamTypeDefaultDescription
y_truenumber[] or number[][]nullGround truth (correct) target values(should be positive).
y_prednumber[] or number[][]nullEstimated target values(should be positive).
options.sample_weightnumbernullSample weights.

Returns:

number