Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
javascript implementation of Dunning's T-Digest for streaming quantile approximation
The tdigest npm package is a JavaScript implementation of Ted Dunning's t-digest algorithm, which is used for accurate online accumulation of rank-based statistics such as quantiles and cumulative distribution functions (CDFs). It is particularly useful for large-scale data processing where memory efficiency and speed are critical.
Creating a t-digest
This feature allows you to create a new t-digest instance, which can then be used to accumulate data and compute statistics.
const TDigest = require('tdigest').TDigest;
const t = new TDigest();
Adding data to the t-digest
This feature allows you to add data points to the t-digest. The t-digest will then use these data points to compute rank-based statistics.
t.push(1.0);
t.push(2.0);
t.push(3.0);
Computing quantiles
This feature allows you to compute quantiles from the data accumulated in the t-digest. For example, you can compute the median (50th percentile) or the 90th percentile.
const q50 = t.percentile(0.5);
const q90 = t.percentile(0.9);
Computing cumulative distribution function (CDF)
This feature allows you to compute the cumulative distribution function (CDF) for a given value. The CDF represents the probability that a random variable takes on a value less than or equal to the given value.
const cdf = t.cdf(2.0);
The simple-statistics package provides a wide range of statistical functions, including quantile calculations. However, it does not implement the t-digest algorithm and may not be as memory efficient for large-scale data processing.
The summary-statistics package offers basic statistical summaries such as mean, median, and standard deviation. It does not provide the advanced rank-based statistics or memory efficiency of the t-digest algorithm.
The descriptive-statistics package provides functions for descriptive statistics, including quantiles. While it offers similar functionality, it does not use the t-digest algorithm and may not be as efficient for large datasets.
tdigest: javascript implementation of Dunning's T-Digest for streaming quantile approximation
FAQs
javascript implementation of Dunning's T-Digest for streaming quantile approximation
The npm package tdigest receives a total of 989,167 weekly downloads. As such, tdigest popularity was classified as popular.
We found that tdigest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.