<h3 dir="auto">Describe the workflow you want to enable</h3>
<p dir="auto">Doing FeatureSelection droping correlated features is standard ml proc that sklearn covers.<br>
But, as i interpret the documentation, sklearn treats the featureSelection based on correlations as a previous step, outside the pipeline.<br>
An in the pipeline, you can only do univarte or iterative featureSelections <a href="https://scikit-learn.org/stable/modules/feature_selection.html#feature-selection-using-selectfrommodel" rel="nofollow">docs</a></p>
<p dir="auto">I would like to do FeatureSelection based on correlations, as a pipeline step</p>
<h3 dir="auto">Describe your proposed solution</h3>
<p dir="auto">something like</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from sklearn.covariance import MinCovDet_
clf = Pipeline([
  ('feature_selection', SelectFromModel(MinCovDet_())),
  ('classification', RandomForestClassifier())
])
clf.fit(X, y)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">covariance</span> <span class="pl-k">import</span> <span class="pl-v">MinCovDet_</span>
<span class="pl-s1">clf</span> <span class="pl-c1">=</span> <span class="pl-v">Pipeline</span>([
  (<span class="pl-s">'feature_selection'</span>, <span class="pl-v">SelectFromModel</span>(<span class="pl-v">MinCovDet_</span>())),
  (<span class="pl-s">'classification'</span>, <span class="pl-v">RandomForestClassifier</span>())
])
<span class="pl-s1">clf</span>.<span class="pl-en">fit</span>(<span class="pl-v">X</span>, <span class="pl-s1">y</span>)</pre></div>
<p dir="auto">Where MinCovDet_ ~ MinCovDet but returns the ingested df, so the classification step can do the fit</p>
<h3 dir="auto">Describe alternatives you've considered, if relevant</h3>
<p dir="auto">Maybe a <code class="notranslate">SelectFromCorrelation</code> wrapper that you can run on top of all the <code class="notranslate">sklearn.covariance</code> correlators would be better</p>
<h3 dir="auto">Additional context</h3>
<p dir="auto"><em>No response</em></p>
<p dir="auto">I wonder whether we should add unsupervised feature selection using correlation. It's a strategy that's very common in statistics and might just have it for completeness.<br>
It's certainly more useful than the variance based one, which I think is useless for any threshold != 0.</p>