https://github.com/javiercejudo/rescale
Feature scaling
https://github.com/javiercejudo/rescale
Last synced: 3 months ago
JSON representation
Feature scaling
- Host: GitHub
- URL: https://github.com/javiercejudo/rescale
- Owner: javiercejudo
- License: mit
- Created: 2015-03-02T08:22:00.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-27T08:41:37.000Z (over 8 years ago)
- Last Synced: 2025-02-28T13:42:47.135Z (3 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/rescale
- Size: 35.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rescale
[](https://travis-ci.org/javiercejudo/rescale)
[](https://coveralls.io/r/javiercejudo/rescale?branch=master)
[](https://codeclimate.com/github/javiercejudo/rescale)Rescale data
## Install
npm i rescale
## Usage
```js
var Decimal = require('linear-arbitrary-precision')(require('floating-adapter'));
var rescale = require('rescale')(Decimal).rescale;rescale([-3, 5], [10, 20], -1); // => Decimal 12.5
rescale([0, 100], [32, 212], 40); // => Decimal 104
```See [spec](test/spec.js).
## Related projects
- [linear-converter](https://github.com/javiercejudo/linear-converter): flexible linear converter with built in conversions for common units.
- [scale](https://github.com/javiercejudo/scale): scales normalised data.
- [normalise](https://github.com/javiercejudo/normalise): normalise data to [0, 1].
- [rescale-util](https://github.com/javiercejudo/rescale-util): rescale utilities.