Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/simplestatistics/src/r_squared.js>default

simple statistics for node & browser javascript
Latest
function default
import { default } from "https://deno.land/x/simplestatistics@v7.8.3/src/r_squared.js";

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.

Examples

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

Parameters

x

input data: this should be doubly-nested

func

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