A package for encoding categorical variables for machine learning
Actively maintained. Last release 5 weeks ago, commits in 9 of the last 26 weeks. A safe choice.
pip install category-encodersCategorical Encoding Methods
A set of scikit-learn-style transformers for encoding categorical variables into numeric by means of different techniques.
Important Links
Documentation: http://contrib.scikit-learn.org/category_encoders/
Encoding Methods
Unsupervised:
- Backward Difference Contrast [2][3]
- BaseN [6]
- Binary [5]
- Gray [14]
- Count [10]
- Hashing [1]
- Helmert Contrast [2][3]
- Ordinal [2][3]
- One-Hot [2][3]
- Multi-Hot [17]
- Rank Hot [15]
- Polynomial Contrast [2][3]
- Sum Contrast [2][3]
Supervised:
- CatBoost [11]
- Count Target Encoding [17]
- Generalized Linear Mixed Model [12]
- James-Stein Estimator [9]
- LeaveOneOut [4]
- M-estimator [7]
- Target Encoding [7]
- Weight of Evidence [8]
- Quantile Encoder [13]
- Summary Encoder [13]
Installation
The package requires: numpy, statsmodels, and scipy.
To install the package, execute:
$ python setup.py install
or
pip install category_encoders
or
conda install -c conda-forge category_encoders
To install the development version, you may use:
pip install --upgrade git+https://github.com/scikit-learn-contrib/category_encoders