# scikit-learn-contrib/category_encoders

A library of sklearn compatible categorical variable encoders

Repository: https://github.com/scikit-learn-contrib/category_encoders
Canonical: https://ross.abutalabs.com/products/category_encoders
Homepage: http://contrib.scikit-learn.org/category_encoders/
Language: Python
License: BSD-3-Clause
License Family: permissive
Last push: 2026-08-25T23:13:51+00:00

## Health v2 (maintenance only)
Score: 94/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 83, longevity 100
- inputs: {"age_days": 3930, "days_push": 8, "days_rel": 38, "gap_med": 54, "n_releases_24m": 8}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2499, forks 411 (observed 2026-08-28T04:06:56.823537+00:00)

## What it is
A scikit-learn-contrib library providing a collection of sklearn-compatible transformers for encoding categorical variables into numeric form using techniques like one-hot, binary, hashing, target, and CatBoost encoding. It supports pandas DataFrames, works in sklearn pipelines, and includes both supervised and unsupervised encoders.

## Use cases
- encode categorical columns for machine learning models
- target encode high-cardinality categorical features
- one-hot encode pandas dataframes in sklearn pipelines
- convert string categories to numbers for sklearn
- avoid target leakage when encoding categories
- pickle and reuse a fitted categorical encoder

## When to choose
- you need sklearn-pipeline-compatible categorical transformers
- you work with pandas DataFrames and want column-level control
- you need supervised encoders like target, CatBoost, or James-Stein encoding

## When to avoid
- your data has no categorical features
- you need deep-learning-native embedding layers instead of tabular encoding
- you are outside the Python/sklearn ecosystem

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, data-science, etl
- domain: machine-learning, data-science
- platform: python
- tags: categorical-encoding, sklearn-transformers, feature-engineering, target-encoding, pandas

## Member repositories
- scikit-learn-contrib/category_encoders (main) score 94

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:56.823537+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:27:00.340826+00:00, confidence not recorded.
  - readme: https://github.com/scikit-learn-contrib/category_encoders (fetched 2026-08-28T04:06:56.823537+00:00, sha 410fc57cd3e6)
  - homepage: http://contrib.scikit-learn.org/category_encoders/ (fetched 2026-08-29T10:09:32.090269+00:00, sha 3492b0148215)
- Data as of 2026-08-30T08:39:29.467469+00:00.
