normalise
v10.0.0
Published
Normalise data to [0, 1]
Downloads
89
Maintainers
Readme
normalise
Normalise data to [0, 1], i.e. feature scaling.
Install
npm i normalise
Usage
var Decimal = require('linear-arbitrary-precision')(require('floating-adapter'));
var normalise = require('normalise')(Decimal).normalise;
normalise([0, 5], 2.5); // => Decimal 0.5
normalise([1, 2], 3); // => Decimal 2
normalise([-5, 1], -3); // => Decimal 1/3
See spec.
Related projects
- linear-converter: flexible linear converter with built in conversions for common units.
- rescale: rescales a point given two scales.
- scale: scales normalised data.
- rescale-util: rescale utilities.