Skip to content

rSquared

rSquared(x, func): number

Defined in: src/r_squared.js:15

The R Squared value of data compared with a function f is the sum of the squared differences between the prediction and the actual value.

number[][]

input data: this should be doubly-nested

Function

function called on [i][0] values within the dataset

number

r-squared value

var samples = [[0, 0], [1, 1]];
var regressionLine = linearRegressionLine(linearRegression(samples));
rSquared(samples, regressionLine); // = 1 this line is a perfect fit