Metadata-Version: 2.5
Name: lightkde
Version: 1.0.5
Summary: Lightning fast, lightweight, and reliable kernel density estimation.
Project-URL: Homepage, https://github.com/rozsasarpi/lightkde
Project-URL: Documentation, https://lightkde.readthedocs.io/en/stable/
Project-URL: Changelog, https://github.com/rozsasarpi/lightkde/blob/main/CHANGELOG.md
Author-email: Arpad Rozsas <rozsasarpi@gmail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.10
Requires-Dist: numpy
Requires-Dist: scipy
Provides-Extra: docs
Requires-Dist: furo; extra == 'docs'
Requires-Dist: matplotlib<4; extra == 'docs'
Requires-Dist: myst-parser; extra == 'docs'
Requires-Dist: sphinx-copybutton; extra == 'docs'
Requires-Dist: sphinx-gallery; extra == 'docs'
Requires-Dist: sphinx-inline-tabs; extra == 'docs'
Requires-Dist: sphinx<9,>=7; extra == 'docs'
Requires-Dist: sphinxcontrib-bibtex; extra == 'docs'
Provides-Extra: lint-type-checks
Requires-Dist: pre-commit; extra == 'lint-type-checks'
Provides-Extra: tests
Requires-Dist: coverage[toml]; extra == 'tests'
Requires-Dist: matplotlib<4; extra == 'tests'
Requires-Dist: pytest; extra == 'tests'
Description-Content-Type: text/markdown

# lightkde

[![Documentation Status](https://readthedocs.org/projects/lightkde/badge/?version=stable)](https://lightkde.readthedocs.io/en/stable/)
[![Continuous integration](https://github.com/rozsasarpi/lightkde/actions/workflows/push.yaml/badge.svg)](https://github.com/rozsasarpi/lightkde/actions)
[![CodeQL](https://github.com/rozsasarpi/lightkde/actions/workflows/codeql.yml/badge.svg)](https://github.com/rozsasarpi/lightkde/actions/workflows/codeql.yml)
[![PyPI version](https://img.shields.io/pypi/v/lightkde)](https://pypi.org/project/lightkde/)
![python versions](https://img.shields.io/pypi/pyversions/lightkde)
[![coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/rozsasarpi/bafe6e5b1382e4c2c49156a01e4803f3/raw/lightkde_main_coverage.json)](https://en.wikipedia.org/wiki/Code_coverage)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)


A lightning fast, lightweight, and reliable kernel density estimation.

* Easy to use, e.g. ``density_vec, x_vec = kde_1d(sample_vec=sample)``\.
* Works with 1d and 2d samples.
* Works with weighted samples as well.
* Based on the MATLAB implementations of Botev:
  [kde](https://www.mathworks.com/matlabcentral/fileexchange/14034-kernel-density-estimator),
  [kde2d](https://www.mathworks.com/matlabcentral/fileexchange/17204-kernel-density-estimation).

![alt text](https://gist.githubusercontent.com/rozsasarpi/022fa396c919fbedabcd78fde9d1801a/raw/9822c2d457fcd5a7ef9b06350f14c9f16ae80b71/illustrative_image.svg)


## Install

```bash
pip install lightkde
```

## Usage

```python
import numpy as np
from lightkde import kde_1d

sample = np.random.randn(1000)

density_vec, x_vec = kde_1d(sample_vec=sample)
```

For further examples see the [documentation](https://lightkde.readthedocs.io/en/latest).

## Other kde packages

Other python packages for kernel density estimation:

* [scipy.stats.gaussian_kde](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.gaussian_kde.html)
* [KDEpy](https://github.com/tommyod/KDEpy)
