brain-pact
v1.0.3
Published
prepare input and reverse output of the neural network library brain
Downloads
4
Maintainers
Readme
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