Normalise data to [0, 1], i.e. feature scaling.
npm i normalise
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.
- 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.