Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@uwdata/kde
Advanced tools
Fast Gaussian kernel density estimation in 1D or 2D. Uses Deriche's approximation for accurate, linear-time O(N + K) estimation.
Fast Gaussian kernel density estimation in 1D or 2D. Uses Deriche's approximation for accurate, linear-time O(N + K) estimation.
All code is written as ESM modules.
To build a bundle (ESM module or minified UMD):
yarn
to install dependencies.yarn build
to build the bundles.Compiled bundles will be written to the dist
directory.
Creates a new 1D density estimator for the input data. Returns an estimator object that includes the methods listed below, and also provides an iterator over resulting density points.
3
, capturing 99% of the density from the most extreme points. Set this value to 0
to trim the density estimate to the minimum and maximum observed data points. This option is ignored if the extent option is provided.Example
// perform 1D estimation with bandwidth = 1 over domain [0, 10]
// returns an iterator over [ { x, y }, ... ] points
kde.density1d([1, 2, 5, 5, 6, 9], { bandwidth: 1, extent: [0, 10] })
# density1d.grid()
Returns the internal grid array of total accumulated density values per bin. To instead produce an array of objects containing coordinate values and probability density function estimates, use density1d.points().
# density1d.points([x, y])
Returns an iterator over objects containing a sample point (x) and density value (y).
"x"
)."y"
).# density1d.bandwidth([bandwidth])
Get or set the bandwidth (standard deviation) of the Gaussian kernel. Setting the bandwidth will update the estimator efficiently without re-performing binning. The extent will remain unchanged, even if previously determined automatically.
Creates a new 2D density estimator for the input data. Returns an estimator object that includes the methods listed below, and also provides an iterator over resulting density points.
0
. If the x option is not function valued, it will be treated as a key to look up on entries of the input data.1
. If the y option is not function valued, it will be treated as a key to look up on entries of the input data.3
, capturing 99% of the density from the most extreme points. Set this value to 0
to trim the density estimate to the minimum and maximum observed data points. This option is ignored if the extent option is provided.[256, 256]
bins. If array-valued, specifies the x- and y-sizes separately. If number-valued, sets both x- and y-sizes to the same value. The returned density estimate will include a total of size[0] * size[1]
equally-spaced sample points over the extent.Example
// perform 2D estimation with bandwidths [1, 1] over extent [[0, 10], [0, 10]]
// use default grid size ([256, 256])
// returns an iterator over [ { x, y, z }, ... ] points
const data = [[1, 1], [1, 2], [5, 4], [5, 3], [6, 2], [8, 7]];
kde.density2d(data, { bandwidth: 1, extent: [0, 10] })
// perform 2D estimation with different bandwidths and extent for x and y
// returns an iterator over [ { x, y, z }, ... ] points
const data = [[1, 1], [1, 2], [5, 4], [5, 3], [6, 2], [8, 7]];
kde.density2d(data, { bandwidth: [1, 0.5], extent: [[1, 9], [1, 8]] })
# density2d.grid()
Returns the internal grid array of total accumulated density values per bin. To instead produce an array of objects containing coordinate values and probability density function estimates, use density2d.points().
# density2d.points([x, y, z])
Returns an iterator over objects containing sample points (x, y) and density value (z).
"x"
)."y"
)."z"
).# density2d.bandwidth([bandwidth])
Get or set the bandwidths (standard deviations) of the Gaussian kernel. If array-valued, specifies the x- and y-bandwidths separately. If number-valued, sets both x- and y-bandwidths to the same value. Setting the bandwidth will update the estimator efficiently without re-performing binning. The extent will remain unchanged, even if previously determined automatically.
# density2d.heatmap([options])
Generate a heatmap image of the 2D density. Returns an HTML canvas element.
r
, g
, b
, and opacity
properties.Calculates a suggested bandwidth for a set of numeric data values, using Scott's normal reference distribution (NRD) heuristic.
FAQs
Fast Gaussian kernel density estimation in 1D or 2D. Uses Deriche's approximation for accurate, linear-time O(N + K) estimation.
We found that @uwdata/kde 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.