Socket
Socket
Sign inDemoInstall

array-normalize

Package Overview
Dependencies
1
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    array-normalize

Normalize array (possibly n-dimensional) to zero mean and unit variance


Version published
Weekly downloads
177K
decreased by-19.52%
Maintainers
2
Install size
12.8 kB
Created
Weekly downloads
 

Readme

Source

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, stride=1, bounds?)

Normalizes n-dimensional array in-place using optional stride for n-dimensions, ie. for 2d data layout is [x, y, x, y, ...].

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 skip bounds detection.

Keywords

FAQs

Last updated on 22 Dec 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc