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

ml-regression-base

Package Overview
Dependencies
Maintainers
6
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 1.0.0 to 1.1.0

src/__tests__/maybeToPrecision.js

10

History.md

@@ -0,1 +1,11 @@

<a name="1.1.0"></a>
# [1.1.0](https://github.com/mljs/ml-regression-base/compare/v1.0.0...v1.1.0) (2017-04-28)
### Features
* add maybeToPrecision ([04a5f9a](https://github.com/mljs/ml-regression-base/commit/04a5f9a))
<a name="1.0.0"></a>

@@ -2,0 +12,0 @@ # 1.0.0 (2017-04-28)

22

lib/index.js
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function maybeToPrecision(value, digits) {
if (value < 0) {
value = 0 - value;
if (typeof digits === 'number') {
return '- ' + value.toPrecision(digits);
} else {
return '- ' + value.toString();
}
} else {
if (typeof digits === 'number') {
return value.toPrecision(digits);
} else {
return value.toString();
}
}
}
class BaseRegression {

@@ -87,2 +106,3 @@ constructor() {

module.exports = BaseRegression;
exports['default'] = BaseRegression;
exports.maybeToPrecision = maybeToPrecision;

2

package.json
{
"name": "ml-regression-base",
"version": "1.0.0",
"version": "1.1.0",
"description": "Base class for regression modules",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -33,2 +33,8 @@ # ml-regression-base

### `maybeToPrecision(value, digits)`
This package also exports a convenience method to transform numbers to readable strings.<br />
If digits is not specified, "value.toString()" is used. Otherwise "value.toPrecision(digits)" is used.<br />
This method can be used to implement `toString()` or `toLaTeX()`.
## License

@@ -35,0 +41,0 @@

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

export {default as maybeToPrecision} from './maybeToPrecision';
export default class BaseRegression {

@@ -2,0 +4,0 @@ constructor() {

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