13.1. Pandas/Polars Output for Transformers with set_output API
This part of the user guide explains how scikit-learn supports tabular data.
13.1.1. Propagation of Feature Names
By default, scikit-learn transformers (estimators with a transform
method) return numpy arrays (sometimes also sparse arrays). Because numpy arrays do
not provide names for the indices of axes/dimensions, prior to version 1.0
the pipeline.Pipeline did not know how to propagate feature names:
The single step estimators did not know how to handle incoming feature names.
The pipeline did not know how to pass feature names from step to step.
In practice, a lot of use cases start with tabular data like a pandas dataframe or a which have column/feature names.