package
Rescale an array into a range
npm install ml-array-rescaleGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Rescale an array into a range.
$ npm install --save ml-array-rescale
rescale(input[, options])Rescales the values in the input so they fit between two new values.
Options:
min: the new minimum value (default: 0)max: the new maximum value (default: 1)output: an array to use for output. You can pass input here to get an in-place modification.import rescale from 'ml-array-rescale';
const result = rescale([0, 1, 2, 3, 4]);
// [0, 0.25, 0.5, 0.75, 1]targos
npm@secmail.targos.dev
Estimated unpacked size across 4 packages.
34.1 kB
Includes dependencies.
3 direct dependencies.