skillfed

sklearndf

Data frame support and feature traceability for `scikit-learn`.

sklearndf v2.4.2 85.6K downloads/30d#13,910 on PyPI62
Permissive license Apache Software License v2.0 AGING released

What it is and what it does

sklearndf is a wrapper library that enhances scikit-learn estimators to preserve pandas DataFrames and feature names through transformations. When you use scikit-learn's transformers, they typically return numpy arrays even if your input was a DataFrame, losing column names in the process. This makes it hard to trace which features went where, especially in complex pipelines with feature engineering steps. sklearndf solves this by providing drop-in replacements (e.g., StandardScalerDF instead of StandardScaler) that return DataFrames with feature names intact.

The library depends on numpy, pandas, scipy, scikit-learn, packaging, and gamma-pytools. It supports Python 3.9 through 3.13 and is marked Production/Stable. The main value is in model inspection and debugging: you can see exactly which original features contributed to each output feature, which is crucial when transformers create new features (like one-hot encoding) or when you need to audit a pipeline's behavior.

Use it for:

  • Inspect and debug scikit-learn pipelines by keeping track of feature names through all transformation steps.
  • One-hot encode categorical features while maintaining a clear mapping from encoded columns back to original features.
  • Audit feature engineering in production models to understand which raw inputs drive each final feature.
  • Build interpretable machine learning workflows where feature lineage is essential for model validation.
  • Integrate scikit-learn into data analysis notebooks where preserving DataFrame structure simplifies downstream exploration.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Wraps scikit-learn estimators to return pandas DataFrames instead of numpy arrays, preserving feature names through transformations and enabling feature traceability across pipelines.

Yes, if you work regularly with scikit-learn pipelines and need to preserve feature names and traceability. The library is stable, has low install friction, and solves a genuine pain point in scikit-learn workflows. Maintenance is aging (last release 345 days ago), so verify compatibility with your scikit-learn version before adopting in new projects. No known security vulnerabilities.

Install

sklearndf on PyPI

pip

pip install sklearndf

uv

uv add sklearndf

poetry

poetry add sklearndf

Installing sklearndf

Before you install

Low install friction with a pure-Python wheel. Maintenance is aging—last release was 345 days ago—but the repository remains active and marked Production/Stable. Depends on well-established libraries: numpy, pandas, scipy, scikit-learn, packaging, and gamma-pytools.

License in practice

Licensed under Apache Software License v2.0 (permissive). You may use, modify, and distribute freely in commercial and private projects, provided you include a copy of the license and state significant changes.

Quickstart

pip install sklearndf

from sklearndf.preprocessing import StandardScalerDF
import pandas as pd

X = pd.DataFrame({'a': [2, 3], 'b': [4, 5]})
scaler = StandardScalerDF()
X_scaled = scaler.fit_transform(X)  # Returns DataFrame with feature names preserved

Requires Python >=3.9 and <4a; scikit-learn, pandas, scipy, numpy, and packaging must be installed.

Verify before relying

  • Whether feature tracing works correctly across all scikit-learn transformer types and custom pipelines.
  • Performance overhead of DataFrame wrapping compared to native scikit-learn arrays.
  • Compatibility with recent scikit-learn versions beyond those explicitly tested.

Package facts

License Apache Software License v2.0 (permissive)
Python support supports the current Python release (<4a,>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 6 — gamma-pytools, numpy, packaging, pandas, scikit-learn, scipy
Maintenance aging — 345 days since the last release
Last repo commit
First released
Downloads 85,647/month — #13,910 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sklearndf-2.4.2-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/Engineering

Tags

scikit-learn dataframe outputpreserve feature names sklearnfeature tracing machine learningsklearn transformer pandasfeature name tracking pipelinedataframe-aware scikit-learnsklearn feature lineage
scikit-learn-wrapperfeature-tracingdataframe-preservation

More Scientific/Engineering packages