Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(x, y, M) {
super();
if (x === true) {
// reloading model
this.A = y.A;
this.M = y.M;
} else {
var n = x.length;
if (n !== y.length) {
throw new RangeError('input and output array have a different length');
}
var linear = new PolynomialRegression(x, y, [M]);
this.A = linear.coefficients[0];
this.M = M;
}
}