--- id: sklearndf version: "2.4.2" license: Apache Software License v2.0 license_treatment: permissive maintenance: aging --- # sklearndf — Data frame support and feature traceability for `scikit-learn`. License: permissive · Maintenance: aging · Downloads: 85.6K/mo ## 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 above — 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 pip install sklearndf uv add sklearndf 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_current - Install friction: low - Maintenance: aging - Downloads: 85.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags scikit-learn dataframe output, preserve feature names sklearn, feature tracing machine learning, sklearn transformer pandas, feature name tracking pipeline, dataframe-aware scikit-learn, sklearn feature lineage, scikit-learn-wrapper, feature-tracing, dataframe-preservation [View on SkillFed](https://skillfed.io/packages/sklearndf) · [View on PyPI](https://pypi.org/project/sklearndf/)