🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

ml-regression-base

Package Overview
Dependencies
Maintainers
7
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ml-regression-base - npm Package Compare versions

Comparing version

to
2.1.4

src/__tests__/checkArraySize.test.js

8

lib/index.js

@@ -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() {