0.0.0 • Published 12 years ago

linear-autoscale v0.0.0

Weekly downloads
2
License
MIT/X11
Repository
github
Last release
12 years ago

linear-autoscale

example

example.js:

var autoscale = require('./index');

var t = autoscale();

var dataset = [-50, 12, 40, 26];

console.log('d: %j', dataset);
console.log('f(d): %j', t(dataset));
console.log('f_inv(f(d)): %j (expect some numerical decay here)',
  t(dataset).inv(t(dataset))
);

output:

$ node example.js 
d: [-50,12,40,26]
f(d): [0,0.6888888888888889,1,0.8444444444444446]
f_inv(f(d)): [-50,11.999999999999996,39.99999999999999,26.000000000000007]
josh@onix:/tmp/scale$ node example.js 
d: [-50,12,40,26]
f(d): [0,0.6888888888888889,1,0.8444444444444446]
f_inv(f(d)): [-50,11.999999999999996,39.99999999999999,26.000000000000007] (expect some numerical decay here)
$

license

MIT/X11