# llquantize

> log/linear quantization

Latest version **0.0.6** (published 2014-02-19) · 0 weekly downloads

## Install

```sh
npm install llquantize
pnpm add llquantize
yarn add llquantize
bun add llquantize
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2014-02-19 |
| First published | 2012-06-14 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | sentientwaffle |
| Maintainers | sentientwaffle |
| Keywords | quantize, quantization, aggregation |

## Links

- npm: https://www.npmjs.com/package/llquantize
- Repository: https://github.com/sentientwaffle/llquantize
- Issues: https://github.com/sentientwaffle/llquantize/issues
- npm.io page: https://npm.io/package/llquantize

## Recent versions

- 0.0.6 (latest) — 2014-02-19
- 0.0.5 — 2012-09-13
- 0.0.4 — 2012-08-16
- 0.0.3 — 2012-07-25
- 0.0.2 — 2012-06-22
- 0.0.1 — 2012-06-14

## README

# llquantize - Log/linear quantization

[![Build Status](https://secure.travis-ci.org/sentientwaffle/llquantize.png?branch=master)](http://travis-ci.org/sentientwaffle/llquantize)

For more information on log/linear quantization, see
[this blog post](http://dtrace.org/blogs/bmc/2011/02/08/llquantize/).

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

---
_Source: https://npm.io/package/llquantize · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
