feature-engine
Feature engineering and selection package with Scikit-learn's fit transform functionality
What it is and what it does
Feature-engine is a Python library that wraps common feature engineering and selection tasks into scikit-learn-compatible transformers. It provides methods for handling missing data, encoding categorical variables, discretising continuous features, capping or removing outliers, transforming and scaling variables, creating new features from existing ones, and selecting the most informative features for modeling. The library depends on numpy, pandas, scikit-learn, scipy, and statsmodels to perform its transformations.
You use it by instantiating a transformer (e.g., RareLabelEncoder, MeanImputer, DropCorrelatedFeatures), calling fit() on training data to learn parameters, and then calling transform() on new data to apply the same transformation. This design integrates naturally into scikit-learn pipelines and cross-validation workflows, making it straightforward to build reproducible feature engineering workflows without writing custom code for each task.
Use it for:
- Encode rare categorical values into a single 'Rare' category to reduce cardinality before modeling.
- Impute missing values using mean, median, or arbitrary strategies learned from training data.
- Remove or cap outliers using statistical methods like Winsorization before training.
- Create datetime-derived features like day-of-week or cyclical encodings from timestamp columns.
- Select the most predictive features using correlation, information value, or model-based elimination.
- Transform skewed variables using log, Box-Cox, or Yeo-Johnson transformations for normality.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Feature-engine provides transformers for engineering, selecting, and preprocessing features in machine learning pipelines, following scikit-learn's fit/transform interface.
Yes. Feature-engine is actively maintained, has no known vulnerabilities, installs with low friction, and provides a comprehensive suite of production-ready transformers that integrate seamlessly with scikit-learn workflows. It is well-suited for anyone building machine learning pipelines who wants to avoid writing repetitive feature engineering code.
Install
feature-engine on PyPI
pip
pip install feature-engineuv
uv add feature-enginepoetry
poetry add feature-engineInstalling feature-engine
Before you install
Low install friction with a pure Python wheel. Active maintenance with a recent release 168 days ago and 2267 GitHub stars. Supports modern Python versions 3.9 through 3.14.
License in practice
BSD 3-clause permissive license allows commercial and private use with minimal restrictions.
Quickstart
pip install feature_engine
import pandas as pd
from feature_engine.encoding import RareLabelEncoder
data = pd.DataFrame({'var_A': ['A']*10 + ['B']*10 + ['C']*2 + ['D']*1})
encoder = RareLabelEncoder(tol=0.10, n_categories=3)
encoded = encoder.fit_transform(data)
Requires Python 3.9 or later.
Verify before relying
- Whether all transformer classes are documented with parameter details and use-case guidance.
- Performance characteristics when applied to large datasets or high-dimensional feature spaces.
- Compatibility behavior when chaining transformers with custom preprocessing pipelines.
Package facts
| License | BSD 3 clause (permissive) |
| Python support | supports the current Python release (>=3.9.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — numpy, pandas, scikit-learn, scipy, statsmodels |
| Maintenance | actively maintained — 168 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 331,267/month — #7,518 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: feature_engine-1.9.4-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
datasieveDataSieve extends scikit-learn's Pipeline to…
permissive · top 15,000 on PyPI
sagemaker-scikit-learn-extensionExtends scikit-learn with additional estimators…
permissive · top 15,000 on PyPI
skforecastSkforecast is a Python library for time series…
permissive · top 15,000 on PyPI
pycaretPyCaret automates machine learning workflows by…
permissive · top 15,000 on PyPI
skrubskrub prepares and transforms dataframes for…
permissive · top 15,000 on PyPI
BorutaBoruta performs all-relevant feature selection…
permissive · top 15,000 on PyPI
sktimesktime provides a unified interface for time…
permissive · top 5,000 on PyPI
transformer-lensTransformerLens loads and inspects the internal…
permissive · top 15,000 on PyPI
sentence-transformersComputes embeddings and reranking scores for…
permissive · top 1,000 on PyPI
yellowbrickYellowbrick provides scikit-learn-integrated…
permissive · top 15,000 on PyPI