ml-regression-base
Advanced tools
Comparing version
@@ -29,3 +29,3 @@ 'use strict'; | ||
function checkArraySize(x, y) { | ||
if (!isAnyArray__default['default'](x) || !isAnyArray__default['default'](y)) { | ||
if (!isAnyArray__default["default"](x) || !isAnyArray__default["default"](y)) { | ||
throw new TypeError('x and y must be arrays'); | ||
@@ -48,3 +48,3 @@ } | ||
return this._predict(x); | ||
} else if (isAnyArray__default['default'](x)) { | ||
} else if (isAnyArray__default["default"](x)) { | ||
const y = []; | ||
@@ -83,3 +83,3 @@ for (let i = 0; i < x.length; i++) { | ||
score(x, y) { | ||
if (!isAnyArray__default['default'](x) || !isAnyArray__default['default'](y) || x.length !== y.length) { | ||
if (!isAnyArray__default["default"](x) || !isAnyArray__default["default"](y) || x.length !== y.length) { | ||
throw new Error('x and y must be arrays of the same length'); | ||
@@ -127,3 +127,3 @@ } | ||
exports.checkArrayLength = checkArraySize; | ||
exports.default = BaseRegression; | ||
exports["default"] = BaseRegression; | ||
exports.maybeToPrecision = maybeToPrecision; |
{ | ||
"name": "ml-regression-base", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"description": "Base class for regression modules", | ||
@@ -38,12 +38,12 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"is-any-array": "^1.0.0" | ||
"is-any-array": "^1.0.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/plugin-transform-modules-commonjs": "^7.13.8", | ||
"@babel/plugin-transform-modules-commonjs": "^7.15.4", | ||
"eslint": "^7.22.0", | ||
"eslint-config-cheminfo": "^5.2.3", | ||
"jest": "^26.6.3", | ||
"prettier": "^2.2.1", | ||
"rollup": "^2.42.3" | ||
"eslint-config-cheminfo": "^6.0.1", | ||
"jest": "^27.2.5", | ||
"prettier": "^2.4.1", | ||
"rollup": "^2.58.0" | ||
} | ||
} |
@@ -12,6 +12,6 @@ declare module 'ml-regression-base' { | ||
predict(x: number[]): number[]; | ||
toString(): string; | ||
toLaTeX(): string; | ||
toString(precision?: number): string; | ||
toLaTeX(precision?: number): string; | ||
score(x: number[], y: number[]): RegressionScore; | ||
} | ||
} |
@@ -5,2 +5,3 @@ import isAnyArray from 'is-any-array'; | ||
export { default as checkArrayLength } from './checkArrayLength'; | ||
export default class BaseRegression { | ||
@@ -7,0 +8,0 @@ constructor() { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
351
4.46%0
-100%14416
-11.04%11
-8.33%Updated