ml-regression-polynomial
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -0,1 +1,6 @@ | ||
<a name="1.0.2"></a> | ||
## [1.0.2](https://github.com/mljs/regression-polynomial/compare/v1.0.1...v1.0.2) (2017-04-28) | ||
<a name="1.0.1"></a> | ||
@@ -2,0 +7,0 @@ ## [1.0.1](https://github.com/mljs/regression-polynomial/compare/v1.0.0...v1.0.1) (2017-04-28) |
@@ -18,8 +18,4 @@ 'use strict'; | ||
} else { | ||
const n = x.length; | ||
if (n !== y.length) { | ||
throw new RangeError('input and output array have a different length'); | ||
} | ||
regress(this, x, y, degree, n); | ||
BaseRegression.checkArrayLength(x, y); | ||
regress(this, x, y, degree); | ||
} | ||
@@ -101,3 +97,4 @@ } | ||
function regress(pr, x, y, degree, n) { | ||
function regress(pr, x, y, degree) { | ||
const n = x.length; | ||
let powers; | ||
@@ -104,0 +101,0 @@ if (Array.isArray(degree)) { |
{ | ||
"name": "ml-regression-polynomial", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Polynomial Regression", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -23,2 +23,3 @@ # regression-polynomial | ||
const regression = new PolynomialRegression(x, y, degree); | ||
console.log(regression.predict(80)); // Apply the model to some x value. Prints 2.6. | ||
@@ -25,0 +26,0 @@ console.log(regression.coefficients); // Prints the coefficients in increasing order of power (from 0 to degree). |
@@ -1,2 +0,2 @@ | ||
import BaseRegression, {maybeToPrecision} from 'ml-regression-base'; | ||
import BaseRegression, {checkArrayLength, maybeToPrecision} from 'ml-regression-base'; | ||
import Matrix, {solve} from 'ml-matrix'; | ||
@@ -12,8 +12,4 @@ | ||
} else { | ||
const n = x.length; | ||
if (n !== y.length) { | ||
throw new RangeError('input and output array have a different length'); | ||
} | ||
regress(this, x, y, degree, n); | ||
checkArrayLength(x, y); | ||
regress(this, x, y, degree); | ||
} | ||
@@ -95,3 +91,4 @@ } | ||
function regress(pr, x, y, degree, n) { | ||
function regress(pr, x, y, degree) { | ||
const n = x.length; | ||
let powers; | ||
@@ -98,0 +95,0 @@ if (Array.isArray(degree)) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41
13302
267