<h4 dir="auto">Describe the bug</h4>
<p dir="auto">Not sure if this is a bug but shouldn't RFECV accept a pipeline?</p>
<h4 dir="auto">Steps/Code to Reproduce</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from imblearn.pipeline import make_pipeline
from imblearn.over_sampling import RandomOverSampler

from sklearn.datasets import load_breast_cancer
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import StratifiedKFold
from sklearn.feature_selection import RFECV
from sklearn.preprocessing import StandardScaler


data = load_breast_cancer()

X = data['data']
y = data['target']

fold = StratifiedKFold()

lr = LogisticRegression()
oversample = RandomOverSampler()
scale = StandardScaler()
pipeline = make_pipeline(oversample, scale, lr)

rfecv = RFECV(estimator=pipeline, step=1, cv=fold, scoring='recall')
rfecv.fit(X, y)"><pre class="notranslate"><code class="notranslate">from imblearn.pipeline import make_pipeline
from imblearn.over_sampling import RandomOverSampler

from sklearn.datasets import load_breast_cancer
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import StratifiedKFold
from sklearn.feature_selection import RFECV
from sklearn.preprocessing import StandardScaler


data = load_breast_cancer()

X = data['data']
y = data['target']

fold = StratifiedKFold()

lr = LogisticRegression()
oversample = RandomOverSampler()
scale = StandardScaler()
pipeline = make_pipeline(oversample, scale, lr)

rfecv = RFECV(estimator=pipeline, step=1, cv=fold, scoring='recall')
rfecv.fit(X, y)
</code></pre></div>
<h4 dir="auto">Expected Results</h4>
<p dir="auto">No error is thrown</p>
<h4 dir="auto">Actual Results</h4>
<p dir="auto">RuntimeError: The classifier does not expose "coef_" or "feature_importances_" attributes</p>
<h4 dir="auto">Versions</h4>
<p dir="auto">Scikit-Learn 0.22<br>
Imbalanced-Learn 0.5.0</p>
<h4 dir="auto">Description</h4>

<p dir="auto">Based on <a href="https://stackoverflow.com/questions/58155778/target-transformation-and-feature-selection-in-scikit-learn/58274933#58274933" rel="nofollow">this </a> SO post.</p>
<p dir="auto"><code class="notranslate">TransformedTargetRegressor</code> is not working with <code class="notranslate">RFECV</code> because <code class="notranslate">coef</code> or <code class="notranslate">feature_importance</code> is not exposed directly in <code class="notranslate">TransformedTargetRegressor</code>.</p>
<h4 dir="auto">Steps/Code to Reproduce</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from sklearn.datasets import make_friedman1
from sklearn.feature_selection import RFECV
from sklearn.linear_model import LinearRegression
from sklearn.compose import TransformedTargetRegressor

X, y = make_friedman1(n_samples=50, n_features=10, random_state=0)
log_estimator = TransformedTargetRegressor(regressor=LinearRegression(),
                                                func=np.log,
                                                inverse_func=np.exp)

log_selector = RFECV(log_estimator, step=1, cv=5, scoring='r2')
log_seletor = log_selector.fit(X,y)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">datasets</span> <span class="pl-k">import</span> <span class="pl-s1">make_friedman1</span>
<span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">feature_selection</span> <span class="pl-k">import</span> <span class="pl-v">RFECV</span>
<span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">linear_model</span> <span class="pl-k">import</span> <span class="pl-v">LinearRegression</span>
<span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">compose</span> <span class="pl-k">import</span> <span class="pl-v">TransformedTargetRegressor</span>

<span class="pl-v">X</span>, <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-en">make_friedman1</span>(<span class="pl-s1">n_samples</span><span class="pl-c1">=</span><span class="pl-c1">50</span>, <span class="pl-s1">n_features</span><span class="pl-c1">=</span><span class="pl-c1">10</span>, <span class="pl-s1">random_state</span><span class="pl-c1">=</span><span class="pl-c1">0</span>)
<span class="pl-s1">log_estimator</span> <span class="pl-c1">=</span> <span class="pl-v">TransformedTargetRegressor</span>(<span class="pl-s1">regressor</span><span class="pl-c1">=</span><span class="pl-v">LinearRegression</span>(),
                                                <span class="pl-s1">func</span><span class="pl-c1">=</span><span class="pl-s1">np</span>.<span class="pl-s1">log</span>,
                                                <span class="pl-s1">inverse_func</span><span class="pl-c1">=</span><span class="pl-s1">np</span>.<span class="pl-s1">exp</span>)

<span class="pl-s1">log_selector</span> <span class="pl-c1">=</span> <span class="pl-v">RFECV</span>(<span class="pl-s1">log_estimator</span>, <span class="pl-s1">step</span><span class="pl-c1">=</span><span class="pl-c1">1</span>, <span class="pl-s1">cv</span><span class="pl-c1">=</span><span class="pl-c1">5</span>, <span class="pl-s1">scoring</span><span class="pl-c1">=</span><span class="pl-s">'r2'</span>)
<span class="pl-s1">log_seletor</span> <span class="pl-c1">=</span> <span class="pl-s1">log_selector</span>.<span class="pl-en">fit</span>(<span class="pl-v">X</span>,<span class="pl-s1">y</span>)</pre></div>
<h4 dir="auto">Expected Results</h4>

<p dir="auto">No error is thrown</p>
<h4 dir="auto">Actual Results</h4>

<p dir="auto">RuntimeError: The classifier does not expose "coef_" or "feature_importances_" attributes</p>