JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q39698F

log/linear quantization

Package Exports

  • llquantize

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (llquantize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

llquantize - Log/linear quantization

Build Status

For more information on log/linear quantization, see this blog post.

To summarize: log/linear quantization addresses the problem of using the wrong aggregation resolution, which leads to "clogging the system with unnecessarily fine-grained data, or discarding valuable information in overly coarse-grained data".

It does this by logarithmically aggregating by order of magnitude, but linearly aggregating within an order of magnitude.

Example

var llquantize = require('llquantize')
  , llq = llquantize()

// Input some data points.
llq(0.54); llq(0.55)
llq(2);    llq(3)
llq(12);   llq(14)
llq(24)
llq(124);  llq(199)

// Get the accumulated data.
llq()
// =>
// { "0.5": 2
// , "2":   1
// , "3":   1
// , "10":  2
// , "20":  1
// , "100": 2
// }

As you can see, the closer to zero the data points approach, the greater the precision used to track/group them (and vice-versa).

API

llquantize([bucket_size=10, [steps=10]])

Arguments:

  • bucket_size - The factor by which the bucket size should increase. (i.e. the first bucket will have the size bucket_size, the next will be bucket_size^2...)
  • steps - The number of divisions per bucket,

Installation

$ npm install llquantize

License

MIT