Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

brain-pact

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brain-pact

prepare input and reverse output of the neural network library brain

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
14
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

Installation

Using npm:

npm install brain-pact

In Node.js:

var pact = require('brain-pact');

prepare date input

let inputOptions = {
  date: {
    type: 'date',
    pattern: ['month', 'week', 'day', 'hour'] //prepare pattern for date
  },
  test: {
    weight: 5 //input property test has maximun value of 5
  }
};
let transition = pact.employ(inputOptions);

let prepared = transition.prepare({ date: Date.now(), test: 4 });
console.log(prepared);
{
  "month": 0.2727272727272727,
  "week": 0.3076923076923077,
  "day": 1,
  "hour": 1,
  "test": 0.8
}

reverse output


let reversed = transition.reverse({ test: 0.8 });
console.log(reversed);
{
  "test": 4
}

License

MIT © Andre Stehle

Keywords

brain

FAQs

Package last updated on 13 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts