Skip to content

Add get_feature_names_out() to DataFrameMapper - #270

Open
pancholi-deep wants to merge 1 commit into
scikit-learn-contrib:masterfrom
pancholi-deep:feature/feature-names
Open

Add get_feature_names_out() to DataFrameMapper#270
pancholi-deep wants to merge 1 commit into
scikit-learn-contrib:masterfrom
pancholi-deep:feature/feature-names

Conversation

@pancholi-deep

Copy link
Copy Markdown

Summary

This PR adds optional support for retrieving transformed output feature names
from DataFrameMapper via a new public method, get_feature_names_out().

Motivation

After transformation, DataFrameMapper returns a NumPy array, which makes it
difficult to associate transformed features with their original input columns.
This limits debuggability, interpretability, and downstream analysis in
real-world machine learning pipelines.

Changes

  • Track transformed feature names during fitting
  • Add get_feature_names_out() public API to DataFrameMapper
  • Support transformers that already expose get_feature_names_out
  • Provide sensible fallback naming for other transformers
  • Add focused tests covering common transformation scenarios
  • Document the feature in the README

Backward Compatibility

  • Existing behavior is unchanged unless get_feature_names_out() is explicitly called
  • No public APIs were modified or removed

Tests

  • All existing tests pass
  • New tests added for feature-name output behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant