<h3 dir="auto">Describe the bug</h3>
<p dir="auto">XGBRegressors accepts nan values. Which is defined in the tag <code class="notranslate">force_all_finite='allow-nan</code><br>
But if define</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="RegressorChain(XGBRegressor())"><pre class="notranslate"><span class="pl-v">RegressorChain</span>(<span class="pl-v">XGBRegressor</span>())</pre></div>
<p dir="auto">Then raises the error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" File &quot;C:\\lib\site-packages\sklearn\multioutput.py&quot;, line 556, in fit
    X, Y = self._validate_data(X, Y, multi_output=True, accept_sparse=True,
  File &quot;C:\\lib\site-packages\sklearn\base.py&quot;, line 581, in _validate_data
    X, y = check_X_y(X, y, **check_params)
  File &quot;C:\\lib\site-packages\sklearn\utils\validation.py&quot;, line 964, in check_X_y
    X = check_array(
  File &quot;C:\\lib\site-packages\sklearn\utils\validation.py&quot;, line 800, in check_array
    _assert_all_finite(array, allow_nan=force_all_finite == &quot;allow-nan&quot;)
  File &quot;C:\\lib\site-packages\sklearn\utils\validation.py&quot;, line 114, in _assert_all_finite
    raise ValueError(
ValueError: Input contains NaN, infinity or a value too large for dtype('float64')."><pre class="notranslate"><code class="notranslate"> File "C:\\lib\site-packages\sklearn\multioutput.py", line 556, in fit
    X, Y = self._validate_data(X, Y, multi_output=True, accept_sparse=True,
  File "C:\\lib\site-packages\sklearn\base.py", line 581, in _validate_data
    X, y = check_X_y(X, y, **check_params)
  File "C:\\lib\site-packages\sklearn\utils\validation.py", line 964, in check_X_y
    X = check_array(
  File "C:\\lib\site-packages\sklearn\utils\validation.py", line 800, in check_array
    _assert_all_finite(array, allow_nan=force_all_finite == "allow-nan")
  File "C:\\lib\site-packages\sklearn\utils\validation.py", line 114, in _assert_all_finite
    raise ValueError(
ValueError: Input contains NaN, infinity or a value too large for dtype('float64').
</code></pre></div>
<p dir="auto">In file "C:\lib\site-packages\sklearn\multioutput.py", line 556, in _BaseChain.fit, doing something like</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class _BaseChain(BaseEstimator, metaclass=ABCMeta):
(...)
def fit():
(...)
    allow_nan = self.base_estimator._get_tags()['allow_nan']
    force_all_finite = 'allow-nan' if allow_nan else True
    X, Y = self._validate_data(X, Y, multi_output=True, accept_sparse=True,
                                   force_all_finite=force_all_finite)"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-s1">_BaseChain</span>(<span class="pl-v">BaseEstimator</span>, <span class="pl-s1">metaclass</span><span class="pl-c1">=</span><span class="pl-v">ABCMeta</span>):
(...)
<span class="pl-k">def</span> <span class="pl-en">fit</span>():
(...)
    <span class="pl-s1">allow_nan</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-s1">base_estimator</span>.<span class="pl-en">_get_tags</span>()[<span class="pl-s">'allow_nan'</span>]
    <span class="pl-s1">force_all_finite</span> <span class="pl-c1">=</span> <span class="pl-s">'allow-nan'</span> <span class="pl-k">if</span> <span class="pl-s1">allow_nan</span> <span class="pl-k">else</span> <span class="pl-c1">True</span>
    <span class="pl-v">X</span>, <span class="pl-v">Y</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">_validate_data</span>(<span class="pl-v">X</span>, <span class="pl-v">Y</span>, <span class="pl-s1">multi_output</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, <span class="pl-s1">accept_sparse</span><span class="pl-c1">=</span><span class="pl-c1">True</span>,
                                   <span class="pl-s1">force_all_finite</span><span class="pl-c1">=</span><span class="pl-s1">force_all_finite</span>)</pre></div>
<p dir="auto">would solve the problem</p>
<h3 dir="auto">Steps/Code to Reproduce</h3>
<p dir="auto">import numpy as np<br>
from sklearn.datasets import make_regression<br>
from sklearn.multioutput import RegressorChain<br>
from xgboost import XGBRegressor</p>
<p dir="auto">model = RegressorChain(XGBRegressor())<br>
scoring = 'neg_root_mean_squared_error'<br>
X, y = make_regression(n_targets=2)<br>
X[0, 0] = np.nan<br>
model.fit(X, y)<br>
print(model.score(X,y))</p>
<h3 dir="auto">Expected Results</h3>
<p dir="auto"><code class="notranslate">fit</code>works, and score = 0.9999</p>
<h3 dir="auto">Actual Results</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" File &quot;C:\\lib\site-packages\sklearn\multioutput.py&quot;, line 556, in fit
    X, Y = self._validate_data(X, Y, multi_output=True, accept_sparse=True,
  File &quot;C:\\lib\site-packages\sklearn\base.py&quot;, line 581, in _validate_data
    X, y = check_X_y(X, y, **check_params)
  File &quot;C:\\lib\site-packages\sklearn\utils\validation.py&quot;, line 964, in check_X_y
    X = check_array(
  File &quot;C:\\lib\site-packages\sklearn\utils\validation.py&quot;, line 800, in check_array
    _assert_all_finite(array, allow_nan=force_all_finite == &quot;allow-nan&quot;)
  File &quot;C:\\lib\site-packages\sklearn\utils\validation.py&quot;, line 114, in _assert_all_finite
    raise ValueError(
ValueError: Input contains NaN, infinity or a value too large for dtype('float64')."><pre class="notranslate"><code class="notranslate"> File "C:\\lib\site-packages\sklearn\multioutput.py", line 556, in fit
    X, Y = self._validate_data(X, Y, multi_output=True, accept_sparse=True,
  File "C:\\lib\site-packages\sklearn\base.py", line 581, in _validate_data
    X, y = check_X_y(X, y, **check_params)
  File "C:\\lib\site-packages\sklearn\utils\validation.py", line 964, in check_X_y
    X = check_array(
  File "C:\\lib\site-packages\sklearn\utils\validation.py", line 800, in check_array
    _assert_all_finite(array, allow_nan=force_all_finite == "allow-nan")
  File "C:\\lib\site-packages\sklearn\utils\validation.py", line 114, in _assert_all_finite
    raise ValueError(
ValueError: Input contains NaN, infinity or a value too large for dtype('float64').
</code></pre></div>
<h3 dir="auto">Versions</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="System:
    python: 3.9.9 (tags/v3.9.9:ccb0e6a, Nov 15 2021, 18:08:50) [MSC v.1929 64 bit (AMD64)]
executable: C:\MyProgramFiles\venv\ds-ltv\Scripts\python.exe
   machine: Windows-10-10.0.19043-SP0
Python dependencies:
          pip: 22.0.4
   setuptools: 57.0.0
      sklearn: 1.0.2
        numpy: 1.22.3
        scipy: 1.8.0
       Cython: None
       pandas: 1.4.2
   matplotlib: 3.5.1
       joblib: 1.1.0
threadpoolctl: 3.1.0
Built with OpenMP: True"><pre class="notranslate">System:
    python: 3.9.9 (tags/v3.9.9:ccb0e6a, Nov 15 2021, 18:08:50) [MSC v.1929 64 bit (AMD64)]
executable: C:<span class="pl-cce">\M</span>yProgramFiles<span class="pl-cce">\v</span>env<span class="pl-cce">\d</span>s-ltv<span class="pl-cce">\S</span>cripts<span class="pl-cce">\p</span>ython.exe
   machine: Windows-10-10.0.19043-SP0
Python dependencies:
          pip: 22.0.4
   setuptools: 57.0.0
      sklearn: 1.0.2
        numpy: 1.22.3
        scipy: 1.8.0
       Cython: None
       pandas: 1.4.2
   matplotlib: 3.5.1
       joblib: 1.1.0
threadpoolctl: 3.1.0
Built with OpenMP: True</pre></div>
<h4 dir="auto">Describe the bug</h4>
<p dir="auto">I can't seem to get the <code class="notranslate">RegressorChain</code> working with pipelines that include a <code class="notranslate">ColumnTransformer</code>. I posted an issue on StackOverflow with more: <a href="https://stackoverflow.com/questions/68430993/sklearn-using-regressorchain-with-columntransformer-in-pipelines" rel="nofollow">https://stackoverflow.com/questions/68430993/sklearn-using-regressorchain-with-columntransformer-in-pipelines</a> .</p>
<p dir="auto">Somewhere in <code class="notranslate">__init__.py / _get_column_indices(X, key)</code> this call fails: <code class="notranslate">all_columns = X.columns</code>  saying <code class="notranslate">'numpy.ndarray' object has no attribute 'columns'</code>. Because this is a known issue with <code class="notranslate">ColumnTransformer</code>, I suspect the <code class="notranslate">RegressorChain</code> can't be used with it.</p>
<p dir="auto">I'm not sure if this is a supported scenario, but the documentation for RegressorChain (<a href="https://scikit-learn.org/stable/modules/generated/sklearn.multioutput.RegressorChain.html" rel="nofollow">https://scikit-learn.org/stable/modules/generated/sklearn.multioutput.RegressorChain.html</a>), for <code class="notranslate">set_params</code>, includes this:</p>
<p dir="auto">"The method works on simple estimators <strong>as well as on nested objects (such as Pipeline)</strong>. The latter have parameters of the form __ so that it’s possible to update each component of a nested object."</p>
<p dir="auto">So I was led to assume it would also work with Pipelines including the column transformer.</p>
<h4 dir="auto">Steps/Code to Reproduce</h4>
<p dir="auto">Any example with a Pipeline containing a ColumnTransformer and a Regressor. The StackOverflow link I included above has my code.</p>
<h4 dir="auto">Expected Results</h4>
<p dir="auto">Fitted pipeline.</p>
<h4 dir="auto">Actual Results</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
C:\ProgramData\Anaconda3\envs\py38aml\lib\site-packages\sklearn\utils\__init__.py in _get_column_indices(X, key)
    373         try:
--&gt; 374             all_columns = X.columns
    375         except AttributeError:

AttributeError: 'numpy.ndarray' object has no attribute 'columns'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
&lt;ipython-input-181-24da1e03388c&gt; in &lt;module&gt;
      3 
      4 chain_regressor = RegressorChain(base_estimator=chain_pipeline) #, order=[1,0,2])
----&gt; 5 chain_regressor.fit(X, y)
      6 
      7 

C:\ProgramData\Anaconda3\envs\py38aml\lib\site-packages\sklearn\multioutput.py in fit(self, X, Y, **fit_params)
    840         self : object
    841         &quot;&quot;&quot;
--&gt; 842         super().fit(X, Y, **fit_params)
    843         return self
    844 

C:\ProgramData\Anaconda3\envs\py38aml\lib\site-packages\sklearn\multioutput.py in fit(self, X, Y, **fit_params)
    507         for chain_idx, estimator in enumerate(self.estimators_):
    508             y = Y[:, self.order_[chain_idx]]
--&gt; 509             estimator.fit(X_aug[:, :(X.shape[1] + chain_idx)], y,
    510                           **fit_params)
    511             if self.cv is not None and chain_idx &lt; len(self.estimators_) - 1:

C:\ProgramData\Anaconda3\envs\py38aml\lib\site-packages\sklearn\compose\_target.py in fit(self, X, y, **fit_params)
    205             self.regressor_ = clone(self.regressor)
    206 
--&gt; 207         self.regressor_.fit(X, y_trans, **fit_params)
    208 
    209         return self

C:\ProgramData\Anaconda3\envs\py38aml\lib\site-packages\sklearn\pipeline.py in fit(self, X, y, **fit_params)
    339         &quot;&quot;&quot;
    340         fit_params_steps = self._check_fit_params(**fit_params)
--&gt; 341         Xt = self._fit(X, y, **fit_params_steps)
    342         with _print_elapsed_time('Pipeline',
    343                                  self._log_message(len(self.steps) - 1)):

C:\ProgramData\Anaconda3\envs\py38aml\lib\site-packages\sklearn\pipeline.py in _fit(self, X, y, **fit_params_steps)
    301                 cloned_transformer = clone(transformer)
    302             # Fit or load from cache the current transformer
--&gt; 303             X, fitted_transformer = fit_transform_one_cached(
    304                 cloned_transformer, X, y, None,
    305                 message_clsname='Pipeline',

C:\ProgramData\Anaconda3\envs\py38aml\lib\site-packages\joblib\memory.py in __call__(self, *args, **kwargs)
    350 
    351     def __call__(self, *args, **kwargs):
--&gt; 352         return self.func(*args, **kwargs)
    353 
    354     def call_and_shelve(self, *args, **kwargs):

C:\ProgramData\Anaconda3\envs\py38aml\lib\site-packages\sklearn\pipeline.py in _fit_transform_one(transformer, X, y, weight, message_clsname, message, **fit_params)
    752     with _print_elapsed_time(message_clsname, message):
    753         if hasattr(transformer, 'fit_transform'):
--&gt; 754             res = transformer.fit_transform(X, y, **fit_params)
    755         else:
    756             res = transformer.fit(X, y, **fit_params).transform(X)

C:\ProgramData\Anaconda3\envs\py38aml\lib\site-packages\sklearn\compose\_column_transformer.py in fit_transform(self, X, y)
    503         self._validate_transformers()
    504         self._validate_column_callables(X)
--&gt; 505         self._validate_remainder(X)
    506 
    507         result = self._fit_transform(X, y, _fit_transform_one)

C:\ProgramData\Anaconda3\envs\py38aml\lib\site-packages\sklearn\compose\_column_transformer.py in _validate_remainder(self, X)
    330         cols = []
    331         for columns in self._columns:
--&gt; 332             cols.extend(_get_column_indices(X, columns))
    333 
    334         remaining_idx = sorted(set(range(self._n_features)) - set(cols))

C:\ProgramData\Anaconda3\envs\py38aml\lib\site-packages\sklearn\utils\__init__.py in _get_column_indices(X, key)
    374             all_columns = X.columns
    375         except AttributeError:
--&gt; 376             raise ValueError(&quot;Specifying the columns using strings is only &quot;
    377                              &quot;supported for pandas DataFrames&quot;)
    378         if isinstance(key, str):

ValueError: Specifying the columns using strings is only supported for pandas DataFrames"><pre class="notranslate"><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span>
<span class="pl-v">AttributeError</span>                            <span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>)
<span class="pl-v">C</span>:\P<span class="pl-s1">rogramData</span>\A<span class="pl-s1">naconda3</span>\e<span class="pl-s1">nvs</span>\p<span class="pl-s1">y38aml</span>\l<span class="pl-s1">ib</span>\s<span class="pl-s1">ite</span><span class="pl-c1">-</span><span class="pl-s1">packages</span>\s<span class="pl-s1">klearn</span>\u<span class="pl-s1">tils</span>\_<span class="pl-s1">_init__</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">_get_column_indices</span>(<span class="pl-v">X</span>, <span class="pl-s1">key</span>)
    <span class="pl-c1">373</span>         <span class="pl-k">try</span>:
<span class="pl-c1">-</span><span class="pl-c1">-&gt;</span> <span class="pl-c1">374</span>             <span class="pl-s1">all_columns</span> <span class="pl-c1">=</span> <span class="pl-v">X</span>.<span class="pl-s1">columns</span>
    <span class="pl-c1">375</span>         <span class="pl-k">except</span> <span class="pl-v">AttributeError</span>:

<span class="pl-v">AttributeError</span>: <span class="pl-s">'numpy.ndarray'</span> <span class="pl-s1">object</span> <span class="pl-s1">has</span> <span class="pl-s1">no</span> <span class="pl-s1">attribute</span> <span class="pl-s">'columns'</span>

<span class="pl-v">During</span> <span class="pl-s1">handling</span> <span class="pl-s1">of</span> <span class="pl-s1">the</span> <span class="pl-s1">above</span> <span class="pl-s1">exception</span>, <span class="pl-s1">another</span> <span class="pl-s1">exception</span> <span class="pl-s1">occurred</span>:

<span class="pl-v">ValueError</span>                                <span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>)
<span class="pl-c1">&lt;</span><span class="pl-s1">ipython</span><span class="pl-c1">-</span><span class="pl-s1">input</span><span class="pl-c1">-</span><span class="pl-c1">181</span><span class="pl-c1">-</span><span class="pl-c1">24</span><span class="pl-s1">da1e03388c</span><span class="pl-c1">&gt;</span> <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>
      <span class="pl-c1">3</span> 
      <span class="pl-c1">4</span> <span class="pl-s1">chain_regressor</span> <span class="pl-c1">=</span> <span class="pl-v">RegressorChain</span>(<span class="pl-s1">base_estimator</span><span class="pl-c1">=</span><span class="pl-s1">chain_pipeline</span>) <span class="pl-c">#, order=[1,0,2])</span>
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">5</span> <span class="pl-s1">chain_regressor</span>.<span class="pl-en">fit</span>(<span class="pl-v">X</span>, <span class="pl-s1">y</span>)
      <span class="pl-c1">6</span> 
      <span class="pl-c1">7</span> 

<span class="pl-v">C</span>:\P<span class="pl-s1">rogramData</span>\A<span class="pl-s1">naconda3</span>\e<span class="pl-s1">nvs</span>\p<span class="pl-s1">y38aml</span>\l<span class="pl-s1">ib</span>\s<span class="pl-s1">ite</span><span class="pl-c1">-</span><span class="pl-s1">packages</span>\s<span class="pl-s1">klearn</span>\m<span class="pl-s1">ultioutput</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">fit</span>(<span class="pl-s1">self</span>, <span class="pl-v">X</span>, <span class="pl-v">Y</span>, <span class="pl-c1">**</span><span class="pl-s1">fit_params</span>)
    <span class="pl-c1">840</span>         <span class="pl-s1">self</span> : <span class="pl-s1">object</span>
    <span class="pl-c1">841</span>         <span class="pl-s">"""</span>
<span class="pl-s">--&gt; 842         super().fit(X, Y, **fit_params)</span>
<span class="pl-s">    843         return self</span>
<span class="pl-s">    844 </span>
<span class="pl-s"></span>
<span class="pl-s">C:\ProgramData\Anaconda3\envs\py38aml\lib\site-packages\sklearn\multioutput.py in fit(self, X, Y, **fit_params)</span>
<span class="pl-s">    507         for chain_idx, estimator in enumerate(self.estimators_):</span>
<span class="pl-s">    508             y = Y[:, self.order_[chain_idx]]</span>
<span class="pl-s">--&gt; 509             estimator.fit(X_aug[:, :(X.shape[1] + chain_idx)], y,</span>
<span class="pl-s">    510                           **fit_params)</span>
<span class="pl-s">    511             if self.cv is not None and chain_idx &lt; len(self.estimators_) - 1:</span>
<span class="pl-s"></span>
<span class="pl-s">C:\ProgramData\Anaconda3\envs\py38aml\lib\site-packages\sklearn\compose\_target.py in fit(self, X, y, **fit_params)</span>
<span class="pl-s">    205             self.regressor_ = clone(self.regressor)</span>
<span class="pl-s">    206 </span>
<span class="pl-s">--&gt; 207         self.regressor_.fit(X, y_trans, **fit_params)</span>
<span class="pl-s">    208 </span>
<span class="pl-s">    209         return self</span>
<span class="pl-s"></span>
<span class="pl-s">C:\ProgramData\Anaconda3\envs\py38aml\lib\site-packages\sklearn\pipeline.py in fit(self, X, y, **fit_params)</span>
<span class="pl-s">    339         """</span>
    <span class="pl-c1">340</span>         <span class="pl-s1">fit_params_steps</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">_check_fit_params</span>(<span class="pl-c1">**</span><span class="pl-s1">fit_params</span>)
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">341</span>         <span class="pl-v">Xt</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">_fit</span>(<span class="pl-v">X</span>, <span class="pl-s1">y</span>, <span class="pl-c1">**</span><span class="pl-s1">fit_params_steps</span>)
    <span class="pl-c1">342</span>         <span class="pl-k">with</span> <span class="pl-en">_print_elapsed_time</span>(<span class="pl-s">'Pipeline'</span>,
    <span class="pl-c1">343</span>                                  <span class="pl-s1">self</span>.<span class="pl-en">_log_message</span>(<span class="pl-en">len</span>(<span class="pl-s1">self</span>.<span class="pl-s1">steps</span>) <span class="pl-c1">-</span> <span class="pl-c1">1</span>)):

<span class="pl-v">C</span>:\P<span class="pl-s1">rogramData</span>\A<span class="pl-s1">naconda3</span>\e<span class="pl-s1">nvs</span>\p<span class="pl-s1">y38aml</span>\l<span class="pl-s1">ib</span>\s<span class="pl-s1">ite</span><span class="pl-c1">-</span><span class="pl-s1">packages</span>\s<span class="pl-s1">klearn</span>\p<span class="pl-s1">ipeline</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">_fit</span>(<span class="pl-s1">self</span>, <span class="pl-v">X</span>, <span class="pl-s1">y</span>, <span class="pl-c1">**</span><span class="pl-s1">fit_params_steps</span>)
    <span class="pl-c1">301</span>                 <span class="pl-s1">cloned_transformer</span> <span class="pl-c1">=</span> <span class="pl-en">clone</span>(<span class="pl-s1">transformer</span>)
    <span class="pl-c1">302</span>             <span class="pl-c"># Fit or load from cache the current transformer</span>
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">303</span>             <span class="pl-v">X</span>, <span class="pl-s1">fitted_transformer</span> <span class="pl-c1">=</span> <span class="pl-s1">fit_transform_one_cached</span>(
    <span class="pl-c1">304</span>                 <span class="pl-s1">cloned_transformer</span>, <span class="pl-v">X</span>, <span class="pl-s1">y</span>, <span class="pl-c1">None</span>,
    <span class="pl-c1">305</span>                 <span class="pl-s1">message_clsname</span><span class="pl-c1">=</span><span class="pl-s">'Pipeline'</span>,

<span class="pl-v">C</span>:\P<span class="pl-s1">rogramData</span>\A<span class="pl-s1">naconda3</span>\e<span class="pl-s1">nvs</span>\p<span class="pl-s1">y38aml</span>\l<span class="pl-s1">ib</span>\s<span class="pl-s1">ite</span><span class="pl-c1">-</span><span class="pl-s1">packages</span>\j<span class="pl-s1">oblib</span>\m<span class="pl-s1">emory</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">__call__</span>(<span class="pl-s1">self</span>, <span class="pl-c1">*</span><span class="pl-s1">args</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>)
    <span class="pl-c1">350</span> 
    <span class="pl-c1">351</span>     <span class="pl-k">def</span> <span class="pl-en">__call__</span>(<span class="pl-s1">self</span>, <span class="pl-c1">*</span><span class="pl-s1">args</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>):
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">352</span>         <span class="pl-s1">return</span> <span class="pl-s1">self</span>.<span class="pl-en">func</span>(<span class="pl-c1">*</span><span class="pl-s1">args</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>)
    <span class="pl-c1">353</span> 
    <span class="pl-c1">354</span>     <span class="pl-k">def</span> <span class="pl-en">call_and_shelve</span>(<span class="pl-s1">self</span>, <span class="pl-c1">*</span><span class="pl-s1">args</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>):

<span class="pl-v">C</span>:\P<span class="pl-s1">rogramData</span>\A<span class="pl-s1">naconda3</span>\e<span class="pl-s1">nvs</span>\p<span class="pl-s1">y38aml</span>\l<span class="pl-s1">ib</span>\s<span class="pl-s1">ite</span><span class="pl-c1">-</span><span class="pl-s1">packages</span>\s<span class="pl-s1">klearn</span>\p<span class="pl-s1">ipeline</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">_fit_transform_one</span>(<span class="pl-s1">transformer</span>, <span class="pl-v">X</span>, <span class="pl-s1">y</span>, <span class="pl-s1">weight</span>, <span class="pl-s1">message_clsname</span>, <span class="pl-s1">message</span>, <span class="pl-c1">**</span><span class="pl-s1">fit_params</span>)
    <span class="pl-c1">752</span>     <span class="pl-k">with</span> <span class="pl-s1">_print_elapsed_time</span>(<span class="pl-s1">message_clsname</span>, <span class="pl-s1">message</span>):
    <span class="pl-c1">753</span>         <span class="pl-k">if</span> <span class="pl-en">hasattr</span>(<span class="pl-s1">transformer</span>, <span class="pl-s">'fit_transform'</span>):
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">754</span>             <span class="pl-s1">res</span> <span class="pl-c1">=</span> <span class="pl-s1">transformer</span>.<span class="pl-en">fit_transform</span>(<span class="pl-v">X</span>, <span class="pl-s1">y</span>, <span class="pl-c1">**</span><span class="pl-s1">fit_params</span>)
    <span class="pl-c1">755</span>         <span class="pl-k">else</span>:
    <span class="pl-c1">756</span>             <span class="pl-s1">res</span> <span class="pl-c1">=</span> <span class="pl-s1">transformer</span>.<span class="pl-en">fit</span>(<span class="pl-v">X</span>, <span class="pl-s1">y</span>, <span class="pl-c1">**</span><span class="pl-s1">fit_params</span>).<span class="pl-en">transform</span>(<span class="pl-v">X</span>)

<span class="pl-v">C</span>:\P<span class="pl-s1">rogramData</span>\A<span class="pl-s1">naconda3</span>\e<span class="pl-s1">nvs</span>\p<span class="pl-s1">y38aml</span>\l<span class="pl-s1">ib</span>\s<span class="pl-s1">ite</span><span class="pl-c1">-</span><span class="pl-s1">packages</span>\s<span class="pl-s1">klearn</span>\c<span class="pl-s1">ompose</span>\_<span class="pl-s1">column_transformer</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">fit_transform</span>(<span class="pl-s1">self</span>, <span class="pl-v">X</span>, <span class="pl-s1">y</span>)
    <span class="pl-c1">503</span>         <span class="pl-s1">self</span>.<span class="pl-en">_validate_transformers</span>()
    <span class="pl-c1">504</span>         <span class="pl-s1">self</span>.<span class="pl-en">_validate_column_callables</span>(<span class="pl-v">X</span>)
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">505</span>         <span class="pl-s1">self</span>.<span class="pl-en">_validate_remainder</span>(<span class="pl-v">X</span>)
    <span class="pl-c1">506</span> 
    <span class="pl-c1">507</span>         <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">_fit_transform</span>(<span class="pl-v">X</span>, <span class="pl-s1">y</span>, <span class="pl-s1">_fit_transform_one</span>)

<span class="pl-v">C</span>:\P<span class="pl-s1">rogramData</span>\A<span class="pl-s1">naconda3</span>\e<span class="pl-s1">nvs</span>\p<span class="pl-s1">y38aml</span>\l<span class="pl-s1">ib</span>\s<span class="pl-s1">ite</span><span class="pl-c1">-</span><span class="pl-s1">packages</span>\s<span class="pl-s1">klearn</span>\c<span class="pl-s1">ompose</span>\_<span class="pl-s1">column_transformer</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">_validate_remainder</span>(<span class="pl-s1">self</span>, <span class="pl-v">X</span>)
    <span class="pl-c1">330</span>         <span class="pl-s1">cols</span> <span class="pl-c1">=</span> []
    <span class="pl-c1">331</span>         <span class="pl-s1">for</span> <span class="pl-s1">columns</span> <span class="pl-c1">in</span> <span class="pl-s1">self</span>.<span class="pl-s1">_columns</span>:
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">332</span>             <span class="pl-s1">cols</span>.<span class="pl-en">extend</span>(<span class="pl-en">_get_column_indices</span>(<span class="pl-v">X</span>, <span class="pl-s1">columns</span>))
    <span class="pl-c1">333</span> 
    <span class="pl-c1">334</span>         <span class="pl-s1">remaining_idx</span> <span class="pl-c1">=</span> <span class="pl-en">sorted</span>(<span class="pl-en">set</span>(<span class="pl-en">range</span>(<span class="pl-s1">self</span>.<span class="pl-s1">_n_features</span>)) <span class="pl-c1">-</span> <span class="pl-en">set</span>(<span class="pl-s1">cols</span>))

<span class="pl-v">C</span>:\P<span class="pl-s1">rogramData</span>\A<span class="pl-s1">naconda3</span>\e<span class="pl-s1">nvs</span>\p<span class="pl-s1">y38aml</span>\l<span class="pl-s1">ib</span>\s<span class="pl-s1">ite</span><span class="pl-c1">-</span><span class="pl-s1">packages</span>\s<span class="pl-s1">klearn</span>\u<span class="pl-s1">tils</span>\_<span class="pl-s1">_init__</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">_get_column_indices</span>(<span class="pl-v">X</span>, <span class="pl-s1">key</span>)
    <span class="pl-c1">374</span>             <span class="pl-s1">all_columns</span> <span class="pl-c1">=</span> <span class="pl-v">X</span>.<span class="pl-s1">columns</span>
    <span class="pl-c1">375</span>         <span class="pl-k">except</span> <span class="pl-v">AttributeError</span>:
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">376</span>             <span class="pl-s1">raise</span> <span class="pl-v">ValueError</span>(<span class="pl-s">"Specifying the columns using strings is only "</span>
    <span class="pl-c1">377</span>                              <span class="pl-s">"supported for pandas DataFrames"</span>)
    <span class="pl-c1">378</span>         <span class="pl-k">if</span> <span class="pl-en">isinstance</span>(<span class="pl-s1">key</span>, <span class="pl-s1">str</span>):

<span class="pl-v">ValueError</span>: <span class="pl-v">Specifying</span> <span class="pl-s1">the</span> <span class="pl-s1">columns</span> <span class="pl-s1">using</span> <span class="pl-s1">strings</span> <span class="pl-c1">is</span> <span class="pl-s1">only</span> <span class="pl-s1">supported</span> <span class="pl-k">for</span> <span class="pl-s1">pandas</span> <span class="pl-v">DataFrames</span></pre></div>
<h4 dir="auto">Versions</h4>
<p dir="auto">System:<br>
python: 3.8.10 (default, May 19 2021, 13:12:57) [MSC v.1916 64 bit (AMD64)]<br>
executable: C:\ProgramData\Anaconda3\envs\py38aml\python.exe<br>
machine: Windows-10-10.0.22000-SP0</p>
<p dir="auto">Python dependencies:<br>
pip: 21.1.3<br>
setuptools: 52.0.0.post20210125<br>
sklearn: 0.24.2<br>
numpy: 1.20.2<br>
scipy: 1.6.2<br>
Cython: None<br>
pandas: 1.2.5<br>
matplotlib: 3.3.4<br>
joblib: 1.0.1<br>
threadpoolctl: 2.2.0</p>
<p dir="auto">Built with OpenMP: True</p>