ml-regression-simple-linear
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -0,1 +1,8 @@ | ||
### [2.0.3](https://github.com/mljs/regression-simple-linear/compare/v2.0.2...v2.0.3) (2021-01-07) | ||
### Bug Fixes | ||
* update typescript definition ([#3](https://github.com/mljs/regression-simple-linear/issues/3)) ([72e5f61](https://github.com/mljs/regression-simple-linear/commit/72e5f6148a8b4bdaf378272b724a05d65b01763c)) | ||
## [2.0.2](https://github.com/mljs/regression-simple-linear/compare/v2.0.1...v2.0.2) (2019-06-19) | ||
@@ -2,0 +9,0 @@ |
@@ -25,3 +25,3 @@ 'use strict'; | ||
slope: this.slope, | ||
intercept: this.intercept | ||
intercept: this.intercept, | ||
}; | ||
@@ -28,0 +28,0 @@ } |
{ | ||
"name": "ml-regression-simple-linear", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Simple Linear Regression", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
import BaseRegression from 'ml-regression-base'; | ||
declare module 'ml-regression-simple-linear' { | ||
declare namespace SimpleLinearRegression { | ||
export interface SLRModel { | ||
name: 'simpleLinearRegression'; | ||
} | ||
} | ||
class SimpleLinearRegression extends BaseRegression { | ||
slope: number; | ||
intercept: number; | ||
coefficients: [number, number]; | ||
declare class SimpleLinearRegression extends BaseRegression { | ||
slope: number; | ||
intercept: number; | ||
coefficients: [number, number]; | ||
constructor(x: number[], y: number[]); | ||
constructor(x: number[], y: number[]); | ||
static load(model: SLRModel): SimpleLinearRegression; | ||
static load(model: SimpleLinearRegression.SLRModel): SimpleLinearRegression; | ||
computeX(y: number): number; | ||
toJSON(): SLRModel; | ||
} | ||
computeX(y: number): number; | ||
toJSON(): SimpleLinearRegression.SLRModel; | ||
} | ||
export = SimpleLinearRegression; | ||
} | ||
export = SimpleLinearRegression; |
@@ -40,3 +40,3 @@ import SLR from '..'; | ||
1.8, | ||
1.83 | ||
1.83, | ||
]; | ||
@@ -58,3 +58,3 @@ const outputs = [ | ||
72.19, | ||
74.46 | ||
74.46, | ||
]; | ||
@@ -129,3 +129,3 @@ | ||
expect(() => new SLR(inputs, outputs)).toThrow( | ||
/x and y arrays must have the same length/ | ||
/x and y arrays must have the same length/, | ||
); | ||
@@ -138,3 +138,3 @@ }); | ||
slope: 1, | ||
intercept: 1 | ||
intercept: 1, | ||
}); | ||
@@ -141,0 +141,0 @@ expect(regression.slope).toBe(1); |
import BaseRegression, { | ||
checkArrayLength, | ||
maybeToPrecision | ||
maybeToPrecision, | ||
} from 'ml-regression-base'; | ||
@@ -23,3 +23,3 @@ | ||
slope: this.slope, | ||
intercept: this.intercept | ||
intercept: this.intercept, | ||
}; | ||
@@ -26,0 +26,0 @@ } |
14260