Skip to main content

Machine learning with dirty categories.

Project description

dirty_cat logo

py_ver pypi_var pypi_dl codecov circleci black

dirty_cat is a Python library that facilitates machine-learning on dirty categorical variables.

For a detailed description of the problem of encoding dirty categorical data, see Similarity encoding for learning with dirty categorical variables [1] and Encoding high-cardinality string categorical variables [2].

If you like the package, please spread the word, and ⭐ the repository!

What can dirty_cat do?

dirty_cat provides tools (TableVectorizer, fuzzy_join…) and encoders (GapEncoder, MinHashEncoder…) for morphological similarities, for which we usually identify three common cases: similarities, typos and variations

The first example notebook goes in-depth on how to identify and deal with dirty data using the dirty_cat library.

What dirty_cat does not

Semantic similarities are currently not supported. For example, the similarity between car and automobile is outside the reach of the methods implemented here.

This kind of problem is tackled by Natural Language Processing methods.

dirty_cat can still help with handling typos and variations in this kind of setting.


dirty_cat can be easily installed via pip:

pip install dirty_cat


Dependencies and minimal versions are listed in the setup file.


If you want to encourage development of dirty_cat, the best thing to do is to spread the word!

If you encounter an issue while using dirty_cat, please open an issue and/or submit a pull request. Don’t hesitate, you’re helping to make this project better for everyone!

Additional resources


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dirty_cat-0.4.1.tar.gz (106.1 kB view hashes)

Uploaded Source

Built Distribution

dirty_cat-0.4.1-py3-none-any.whl (125.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page