Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ml-regression-base

Package Overview
Dependencies
Maintainers
8
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 2.0.1 to 2.1.0

9

History.md

@@ -0,1 +1,10 @@

# [2.1.0](https://github.com/mljs/regression-base/compare/v2.0.1...v2.1.0) (2020-02-04)
### Features
* allow types array ([28adfa8](https://github.com/mljs/regression-base/commit/28adfa86c8c7feb491565e060ee16705991e98cf))
## [2.0.1](https://github.com/mljs/regression-base/compare/v2.0.0...v2.0.1) (2019-04-30)

@@ -2,0 +11,0 @@

8

lib/index.js

@@ -5,2 +5,6 @@ 'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var isAnyArray = _interopDefault(require('is-any-array'));
function maybeToPrecision(value, digits) {

@@ -24,3 +28,3 @@ if (value < 0) {

function checkArraySize(x, y) {
if (!Array.isArray(x) || !Array.isArray(y)) {
if (!isAnyArray(x) || !isAnyArray(y)) {
throw new TypeError('x and y must be arrays');

@@ -114,3 +118,3 @@ }

chi2: chi2,
rmsd: Math.sqrt(rmsd / n)
rmsd: Math.sqrt(rmsd / n),
};

@@ -117,0 +121,0 @@ }

{
"name": "ml-regression-base",
"version": "2.0.1",
"version": "2.1.0",
"description": "Base class for regression modules",

@@ -37,14 +37,19 @@ "main": "lib/index.js",

},
"dependencies": {
"is-any-array": "0.0.3"
},
"devDependencies": {
"babel-jest": "^24.7.1",
"@babel/plugin-transform-modules-commonjs": "^7.4.4",
"eslint": "^5.16.0",
"eslint-config-cheminfo": "^1.20.1",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jest": "^22.5.1",
"eslint-plugin-no-only-tests": "^2.3.0",
"jest": "^24.7.1",
"rollup": "^1.10.1"
},
"dependencies": {}
"@babel/plugin-transform-modules-commonjs": "^7.8.3",
"babel-jest": "^25.1.0",
"eslint": "^6.8.0",
"eslint-config-cheminfo": "^2.0.4",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jest": "^23.6.0",
"eslint-plugin-no-only-tests": "^2.4.0",
"eslint-plugin-prettier": "^3.1.2",
"jest": "^25.1.0",
"npm-run-all": "^4.1.5",
"prettier": "^1.19.1",
"rollup": "^1.31.0"
}
}

@@ -30,3 +30,3 @@ import maybeToPrecision from '../maybeToPrecision';

it('wrong digit option', () => {
expect(function () {
expect(function() {
maybeToPrecision(0, 0);

@@ -33,0 +33,0 @@ }).toThrow(/toPrecision\(\) argument must be between 1 and (100|21)/);

@@ -16,3 +16,3 @@ import BaseRegression from '..';

it('should not be directly constructable', () => {
expect(function () {
expect(function() {
// eslint-disable-next-line no-new

@@ -25,3 +25,3 @@ new BaseRegression();

const reg = new NoPredict();
expect(function () {
expect(function() {
reg.predict(0);

@@ -40,3 +40,3 @@ }).toThrow(/_predict must be implemented/);

const basic = new Basic(2);
expect(function () {
expect(function() {
basic.predict();

@@ -59,3 +59,3 @@ }).toThrow(/must be a number or array/);

chi2: 0,
rmsd: 0
rmsd: 0,
});

@@ -68,5 +68,5 @@ expect(basic.score([1, 2], [2, 4.1]).rmsd).toBe(0.0707106781186545);

chi2: 6.5,
rmsd: 1.7677669529663689
rmsd: 1.7677669529663689,
});
});
});

@@ -0,3 +1,5 @@

import isAnyArray from 'is-any-array';
export default function checkArraySize(x, y) {
if (!Array.isArray(x) || !Array.isArray(y)) {
if (!isAnyArray(x) || !isAnyArray(y)) {
throw new TypeError('x and y must be arrays');

@@ -4,0 +6,0 @@ }

@@ -85,5 +85,5 @@ export { default as maybeToPrecision } from './maybeToPrecision';

chi2: chi2,
rmsd: Math.sqrt(rmsd / n)
rmsd: Math.sqrt(rmsd / n),
};
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc