array-normalize
Normalize array (possibly n-dimensional) to zero mean and unit variance
Last updated a year ago by dfcreative .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install array-normalize 
SYNC missed versions from official npm registry.

array-normalize experimental Build Status

Normalize array to unit length, that is 0..1 range. See feature scaling.

npm install array-normalize

const normalize = require('array-normalize')

normalize([0, 50, 100]) // [0, .5, 1]
normalize([0, 0, .1, .2, 1, 2], 2) // [0, 0, .1, .1, 1, 1]
normalize([0, .25, 1, .25], 2, [0, .5, 1, .5]) // [0, .5, 1, .5])

API

array = normalize(array, dimensions=1, bounds?)

Normalizes n-dimensional array in-place using dimensions as stride, ie. for 1d array the expected data layout is [x, x, x, ...] for 2d is [x, y, x, y, ...], etc.

Every dimension is normalized independently, eg. 2d array is normalized to unit square [0, 0, 1, 1].

Optional bounds box can predefine min/max to optimize calculations.

Current Tags

  • 1.1.4                                ...           latest (a year ago)

7 Versions

  • 1.1.4                                ...           a year ago
  • 1.1.3                                ...           3 years ago
  • 1.1.2                                ...           3 years ago
  • 1.1.1                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (2)
Downloads
Today 9
This Week 277
This Month 1,208
Last Day 108
Last Week 337
Last Month 1,451
Dependencies (1)
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |