Kernel density integral transformation
Low maintenance activity. Last release 13 months ago, commits in 1 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install kditransformkditransform
The kernel-density integral transformation (McCarter, 2023, TMLR), like min-max scaling and quantile transformation, maps continuous features to the range [0, 1].
It achieves a happy balance between these two transforms, preserving the shape of the input distribution like min-max scaling, while nonlinearly attenuating the effect of outliers like quantile transformation.
It can also be used to discretize features, offering a data-driven alternative to univariate clustering or K-bins discretization.
You can tune the interpolation $\alpha$ between 0 (quantile transform) and $\infty$ (min-max transform), but a good default is $\alpha=1$, which is equivalent to using scipy.stats.gaussian_kde(bw_method=1). This is an easy way to improves performance for a lot of supervised learning problems. See this notebook for example usage and the paper for a detailed description of the method.
rMSE on CA Housing
Installation
Installation from PyPI
pip install kditransform
Installation from source
After cloning this repo, install the dependencies on the command-line, then install kditransform:
pip install -r requirements.txt
pip install -e .
pytest
Usage
is a drop-in replacement for . When (defaults to 1.0) is small, our method behaves like the QuantileTransformer; when is large, it behaves like .