<p dir="auto">I have a pipeline object with two steps, StandardScaler() and ElasticNet(). When I try to access the feature_names_in_ attribute of the trained ElasticNet(), I am getting an error.</p>
<p dir="auto">This is how I'm fitting the pipeline (no errors)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pipe = Pipeline([
        ('scale', StandardScaler()),
        ('estimator', ElasticNet())])
pipe.fit(X, y)"><pre class="notranslate"><code class="notranslate">pipe = Pipeline([
        ('scale', StandardScaler()),
        ('estimator', ElasticNet())])
pipe.fit(X, y)
</code></pre></div>
<p dir="auto">This is how I'm trying to access the attributes.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="model_coef = pipe.named_steps['estimator'].coef_
model_feature_names = pipe.named_steps['estimator'].feature_names_in_"><pre class="notranslate"><code class="notranslate">model_coef = pipe.named_steps['estimator'].coef_
model_feature_names = pipe.named_steps['estimator'].feature_names_in_
</code></pre></div>
<p dir="auto">This is the error message.</p>
<hr>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_32626/1722639289.py in &lt;module&gt;
      1 model_coef = pipe.named_steps['estimator'].coef_
----&gt; 2 model_feature_names = pipe.named_steps['estimator'].feature_names_in_

AttributeError: 'ElasticNet' object has no attribute 'feature_names_in_'"><pre class="notranslate"><code class="notranslate">AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_32626/1722639289.py in &lt;module&gt;
      1 model_coef = pipe.named_steps['estimator'].coef_
----&gt; 2 model_feature_names = pipe.named_steps['estimator'].feature_names_in_

AttributeError: 'ElasticNet' object has no attribute 'feature_names_in_'
</code></pre></div>
<p dir="auto">As you can see, accessing the coef_ attribute works just fine.</p>
<h1 dir="auto"></h1>
<p dir="auto">ERROR: sklearn.tests.test_common.test_transformer_n_iter('CCA', CCA(copy=True, m</p>
<h2 dir="auto">ax_iter=500, n_components=2, scale=True, tol=1e-06))</h2>
<p dir="auto">Traceback (most recent call last):<br>
File "C:\Python27\lib\site-packages\nose\case.py", line 197, in runTest<br>
self.test(*self.arg)<br>
File "C:\Python27\lib\site-packages\sklearn\utils\estimator_checks.py", line 1<br>
112, in check_transformer_n_iter<br>
estimator.fit(X, y_)<br>
File "C:\Python27\lib\site-packages\sklearn\cross_decomposition\pls_.py", line<br>
329, in fit<br>
linalg.pinv(np.dot(self.x_loadings_.T, self.x_weights_)))<br>
File "C:\Python27\lib\site-packages\scipy\linalg\basic.py", line 600, in pinv<br>
a = np.asarray_chkfinite(a)<br>
File "C:\Python27\lib\site-packages\numpy\lib\function_base.py", line 595, in<br>
asarray_chkfinite<br>
"array must not contain infs or NaNs")<br>
ValueError: array must not contain infs or NaNs</p>
<hr>
<p dir="auto">Ran 4063 tests in 126.356s</p>
<p dir="auto">FAILED (SKIP=25, errors=1)</p>