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
| Parameter | Type |
|---|---|
yTrue | ArrayLike<number> |
yPred | ArrayLike<number> |
Returns
number