multiregress
v1.0.0
Published
Multiple linear regression.
Downloads
32
Maintainers
Readme
multiregress
multiregress
Multiple linear regression.
How to use
Call regression function with datas. Regression function returns constant and coefficients.
const { regression } = require("../dist/index");
//data : [input_1, input_2, ... input_n, output]
//result : [const, coefficient_1, coefficient_2, ... coefficient_n]
//f(x) = 0.5x^2 - 0.5x
console.log(regression([[1, 1, 0], [2, 4, 1], [0, 0, 0]])); // ~ [0, -0.5, 0.5]