<h3 dir="auto">Describe the workflow you want to enable</h3>
<p dir="auto">Enable <code class="notranslate">preprocessor.get_feature_names_out()</code> where <code class="notranslate">preprocessor</code> is a ColumnTransformer with SimpleImputer.</p>
<h3 dir="auto">Describe your proposed solution</h3>
<p dir="auto">If you do this on sklearn v1.0, you get the error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="AttributeError: Transformer simpleimputer-1 (type SimpleImputer) does not provide get_feature_names_out."><pre class="notranslate"><code class="notranslate">AttributeError: Transformer simpleimputer-1 (type SimpleImputer) does not provide get_feature_names_out.
</code></pre></div>
<p dir="auto">The solution is to add <code class="notranslate">get_feature_names_out()</code> to <code class="notranslate">SimpleImputer</code>. This should be fairly straightforward, since there's a one-to-one mapping between input and output features in this transformer. Additionally, it's high impact since <code class="notranslate">SimpleImputer</code> is a common use case when preprocessing data.</p>
<h3 dir="auto">Describe alternatives you've considered, if relevant</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional context</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Describe the workflow you want to enable</h3>
<p dir="auto">I would like to get the feature names input to a classifier after imputation.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="column_trans = ColumnTransformer([('imputed', SimpleImputer(add_indicator=True), x_con)], remainder='drop')
# column_trans = ColumnTransformer([('scaler', preprocessing.StandardScaler(), x_con)], remainder='drop')
pipe = make_pipeline(column_trans, LogisticRegressionCV(cv=2, random_state=0))
pipe.fit(X, y)
pipe[:-1].get_feature_names_out()"><pre class="notranslate"><code class="notranslate">column_trans = ColumnTransformer([('imputed', SimpleImputer(add_indicator=True), x_con)], remainder='drop')
# column_trans = ColumnTransformer([('scaler', preprocessing.StandardScaler(), x_con)], remainder='drop')
pipe = make_pipeline(column_trans, LogisticRegressionCV(cv=2, random_state=0))
pipe.fit(X, y)
pipe[:-1].get_feature_names_out()
</code></pre></div>
<h3 dir="auto">Describe your proposed solution</h3>
<p dir="auto">Implement get_feature_names_out for SimpleImputer as it is implemented for other transformers e.g. it works for StandardScaler.</p>
<h3 dir="auto">Describe alternatives you've considered, if relevant</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional context</h3>
<p dir="auto"><em>No response</em></p>