Skip to content

Function: r2()

ts
function r2(yTrue, yPred): number;

Defined in: ml/metrics.ts:233

Coefficient of determination: the fraction of variance the model explains. 1 is perfect, 0 matches predicting the mean, negative is worse than that.

Parameters

ParameterType
yTrueArrayLike<number>
yPredArrayLike<number>

Returns

number

MIT licensed. WebGL2 required.