class_docstr: Applies transformers to columns of an array or pandas DataFrame.
  
  This estimator allows different columns or column subsets of the input
  to be transformed separately and the features generated by each transformer
  will be concatenated to form a single feature space.
  This is useful for heterogeneous or columnar data, to combine several
  feature extraction mechanisms or transformations into a single transformer.
  
  Read more in the :ref:`User Guide <column_transformer>`.
  
  .. versionadded:: 0.20
  
  Parameters
  ----------
  transformers : list of tuples
      List of (name, transformer, columns) tuples specifying the
      transformer objects to be applied to subsets of the data.
  
      name : str
          Like in Pipeline and FeatureUnion, this allows the transformer and
          its parameters to be set using ``set_params`` and searched in grid
          search.
      transformer : {'drop', 'passthrough'} or estimator
          Estimator must support :term:`fit` and :term:`transform`.
          Special-cased strings 'drop' and 'passthrough' are accepted as
          well, to indicate to drop the columns or to pass them through
          untransformed, respectively.
      columns :  str, array-like of str, int, array-like of int,                 array-like of bool, slice or callable
          Indexes the data on its second axis. Integers are interpreted as
          positional columns, while strings can reference DataFrame columns
          by name.  A scalar string or int should be used where
          ``transformer`` expects X to be a 1d array-like (vector),
          otherwise a 2d array will be passed to the transformer.
          A callable is passed the input data `X` and can return any of the
          above. To select multiple columns by name or dtype, you can use
          :obj:`make_column_selector`.
  
  remainder : {'drop', 'passthrough'} or estimator, default='drop'
      By default, only the specified columns in `transformers` are
      transformed and combined in the output, and the non-specified
      columns are dropped. (default of ``'drop'``).
      By specifying ``remainder='passthrough'``, all remaining columns that
      were not specified in `transformers`, but present in the data passed
      to `fit` will be automatically passed through. This subset of columns
      is concatenated with the output of the transformers. For dataframes,
      extra columns not seen during `fit` will be excluded from the output
      of `transform`.
      By setting ``remainder`` to be an estimator, the remaining
      non-specified columns will use the ``remainder`` estimator. The
      estimator must support :term:`fit` and :term:`transform`.
      Note that using this feature requires that the DataFrame columns
      input at :term:`fit` and :term:`transform` have identical order.
  
  sparse_threshold : float, default=0.3
      If the output of the different transformers contains sparse matrices,
      these will be stacked as a sparse matrix if the overall density is
      lower than this value. Use ``sparse_threshold=0`` to always return
      dense.  When the transformed output consists of all dense data, the
      stacked result will be dense, and this keyword will be ignored.
  
  n_jobs : int, default=None
      Number of jobs to run in parallel.
      ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
      ``-1`` means using all processors. See :term:`Glossary <n_jobs>`
      for more details.
  
  transformer_weights : dict, default=None
      Multiplicative weights for features per transformer. The output of the
      transformer is multiplied by these weights. Keys are transformer names,
      values the weights.
  
  verbose : bool, default=False
      If True, the time elapsed while fitting each transformer will be
      printed as it is completed.
  
  verbose_feature_names_out : bool, default=True
      If True, :meth:`ColumnTransformer.get_feature_names_out` will prefix
      all feature names with the name of the transformer that generated that
      feature.
      If False, :meth:`ColumnTransformer.get_feature_names_out` will not
      prefix any feature names and will error if feature names are not
      unique.
  
      .. versionadded:: 1.0
  
  Attributes
  ----------
  transformers_ : list
      The collection of fitted transformers as tuples of (name,
      fitted_transformer, column). `fitted_transformer` can be an estimator,
      or `'drop'`; `'passthrough'` is replaced with an equivalent
      :class:`~sklearn.preprocessing.FunctionTransformer`. In case there were
      no columns selected, this will be the unfitted transformer. If there
      are remaining columns, the final element is a tuple of the form:
      ('remainder', transformer, remaining_columns) corresponding to the
      ``remainder`` parameter. If there are remaining columns, then
      ``len(transformers_)==len(transformers)+1``, otherwise
      ``len(transformers_)==len(transformers)``.
  
  named_transformers_ : :class:`~sklearn.utils.Bunch`
      Read-only attribute to access any transformer by given name.
      Keys are transformer names and values are the fitted transformer
      objects.
  
  sparse_output_ : bool
      Boolean flag indicating whether the output of ``transform`` is a
      sparse matrix or a dense numpy array, which depends on the output
      of the individual transformers and the `sparse_threshold` keyword.
  
  output_indices_ : dict
      A dictionary from each transformer name to a slice, where the slice
      corresponds to indices in the transformed output. This is useful to
      inspect which transformer is responsible for which transformed
      feature(s).
  
      .. versionadded:: 1.0
  
  n_features_in_ : int
      Number of features seen during :term:`fit`. Only defined if the
      underlying transformers expose such an attribute when fit.
  
      .. versionadded:: 0.24
  
  feature_names_in_ : ndarray of shape (`n_features_in_`,)
      Names of features seen during :term:`fit`. Defined only when `X`
      has feature names that are all strings.
  
      .. versionadded:: 1.0
  
  See Also
  --------
  make_column_transformer : Convenience function for
      combining the outputs of multiple transformer objects applied to
      column subsets of the original feature space.
  make_column_selector : Convenience function for selecting
      columns based on datatype or the columns name with a regex pattern.
  
  Notes
  -----
  The order of the columns in the transformed feature matrix follows the
  order of how the columns are specified in the `transformers` list.
  Columns of the original feature matrix that are not specified are
  dropped from the resulting transformed feature matrix, unless specified
  in the `passthrough` keyword. Those columns specified with `passthrough`
  are added at the right to the output of the transformers.
  
  Examples
  --------
  >>> import numpy as np
  >>> from sklearn.compose import ColumnTransformer
  >>> from sklearn.preprocessing import Normalizer
  >>> ct = ColumnTransformer(
  ...     [("norm1", Normalizer(norm='l1'), [0, 1]),
  ...      ("norm2", Normalizer(norm='l1'), slice(2, 4))])
  >>> X = np.array([[0., 1., 2., 2.],
  ...               [1., 1., 0., 1.]])
  >>> # Normalizer scales each row of X to unit norm. A separate scaling
  >>> # is applied for the two first and two last elements of each
  >>> # row independently.
  >>> ct.fit_transform(X)
  array([[0. , 1. , 0.5, 0.5],
         [0.5, 0.5, 0. , 1. ]])
  
  :class:`ColumnTransformer` can be configured with a transformer that requires
  a 1d array by setting the column to a string:
  
  >>> from sklearn.feature_extraction import FeatureHasher
  >>> from sklearn.preprocessing import MinMaxScaler
  >>> import pandas as pd   # doctest: +SKIP
  >>> X = pd.DataFrame({
  ...     "documents": ["First item", "second one here", "Is this the last?"],
  ...     "width": [3, 4, 5],
  ... })  # doctest: +SKIP
  >>> # "documents" is a string which configures ColumnTransformer to
  >>> # pass the documents column as a 1d array to the FeatureHasher
  >>> ct = ColumnTransformer(
  ...     [("text_preprocess", FeatureHasher(input_type="string"), "documents"),
  ...      ("num_preprocess", MinMaxScaler(), ["width"])])
  >>> X_trans = ct.fit_transform(X)  # doctest: +SKIP
  
  For a more detailed example of usage, see
  :ref:`sphx_glr_auto_examples_compose_plot_column_transformer_mixed_types.py`.
class_docstr_tok: ["Applies","transformers","to","columns","of","an","array","or","pandas","DataFrame",".","This","estimator","allows","different","columns","or","column","subsets","of","the","input","to","be","transformed","separately","and","the","features","generated","by","each","transformer","will","be","concatenated","to","form","a","single","feature","space",".","This","is","useful","for","heterogeneous","or","columnar","data",",","to","combine","several","feature","extraction","mechanisms","or","transformations","into","a","single","transformer",".","Read","more","in","the",":","ref",":","`","User","Guide","<","column_transformer",">","`",".","..","versionadded",":",":","0.20","Parameters","--","--","--","--","--","transformers",":","list","of","tuples","List","of","(","name",",","transformer",",","columns",")","tuples","specifying","the","transformer","objects","to","be","applied","to","subsets","of","the","data",".","name",":","str","Like","in","Pipeline","and","FeatureUnion",",","this","allows","the","transformer","and","its","parameters","to","be","set","using","``","set_params","``","and","searched","in","grid","search",".","transformer",":","{","'drop","'",",","'passthrough","'","}","or","estimator","Estimator","must","support",":","term",":","`","fit","`","and",":","term",":","`","transform","`",".","Special-cased","strings","'drop","'","and","'passthrough","'","are","accepted","as","well",",","to","indicate","to","drop","the","columns","or","to","pass","them","through","untransformed",",","respectively",".","columns",":","str",",","array-like","of","str",",","int",",","array-like","of","int",",","array-like","of","bool",",","slice","or","callable","Indexes","the","data","on","its","second","axis",".","Integers","are","interpreted","as","positional","columns",",","while","strings","can","reference","DataFrame","columns","by","name",".","A","scalar","string","or","int","should","be","used","where","``","transformer","``","expects","X","to","be","a","1d","array-like","(","vector",")",",","otherwise","a","2d","array","will","be","passed","to","the","transformer",".","A","callable","is","passed","the","input","data","`","X","`","and","can","return","any","of","the","above",".","To","select","multiple","columns","by","name","or","dtype",",","you","can","use",":","obj",":","`","make_column_selector","`",".","remainder",":","{","'drop","'",",","'passthrough","'","}","or","estimator",",","default='drop'","By","default",",","only","the","specified","columns","in","`","transformers","`","are","transformed","and","combined","in","the","output",",","and","the","non-specified","columns","are","dropped",".","(","default","of","``","'drop","'","``",")",".","By","specifying","``","remainder='passthrough","'","``",",","all","remaining","columns","that","were","not","specified","in","`","transformers","`",",","but","present","in","the","data","passed","to","`","fit","`","will","be","automatically","passed","through",".","This","subset","of","columns","is","concatenated","with","the","output","of","the","transformers",".","For","dataframes",",","extra","columns","not","seen","during","`","fit","`","will","be","excluded","from","the","output","of","`","transform","`",".","By","setting","``","remainder","``","to","be","an","estimator",",","the","remaining","non-specified","columns","will","use","the","``","remainder","``","estimator",".","The","estimator","must","support",":","term",":","`","fit","`","and",":","term",":","`","transform","`",".","Note","that","using","this","feature","requires","that","the","DataFrame","columns","input","at",":","term",":","`","fit","`","and",":","term",":","`","transform","`","have","identical","order",".","sparse_threshold",":","float",",","default=0.3","If","the","output","of","the","different","transformers","contains","sparse","matrices",",","these","will","be","stacked","as","a","sparse","matrix","if","the","overall","density","is","lower","than","this","value",".","Use","``","sparse_threshold=0","``","to","always","return","dense",".","When","the","transformed","output","consists","of","all","dense","data",",","the","stacked","result","will","be","dense",",","and","this","keyword","will","be","ignored",".","n_jobs",":","int",",","default=None","Number","of","jobs","to","run","in","parallel",".","``","None","``","means","1","unless","in","a",":","obj",":","`","joblib.parallel_backend","`","context",".","``","-1","``","means","using","all","processors",".","See",":","term",":","`","Glossary","<","n_jobs",">","`","for","more","details",".","transformer_weights",":","dict",",","default=None","Multiplicative","weights","for","features","per","transformer",".","The","output","of","the","transformer","is","multiplied","by","these","weights",".","Keys","are","transformer","names",",","values","the","weights",".","verbose",":","bool",",","default=False","If","True",",","the","time","elapsed","while","fitting","each","transformer","will","be","printed","as","it","is","completed",".","verbose_feature_names_out",":","bool",",","default=True","If","True",",",":","meth",":","`","ColumnTransformer.get_feature_names_out","`","will","prefix","all","feature","names","with","the","name","of","the","transformer","that","generated","that","feature",".","If","False",",",":","meth",":","`","ColumnTransformer.get_feature_names_out","`","will","not","prefix","any","feature","names","and","will","error","if","feature","names","are","not","unique",".","..","versionadded",":",":","1.0","Attributes","--","--","--","--","--","transformers_",":","list","The","collection","of","fitted","transformers","as","tuples","of","(","name",",","fitted_transformer",",","column",")",".","`","fitted_transformer","`","can","be","an","estimator",",","or","`","'drop","'","`",";","`","'passthrough","'","`","is","replaced","with","an","equivalent",":","class",":","`","~sklearn.preprocessing.FunctionTransformer","`",".","In","case","there","were","no","columns","selected",",","this","will","be","the","unfitted","transformer",".","If","there","are","remaining","columns",",","the","final","element","is","a","tuple","of","the","form",":","(","'remainder","'",",","transformer",",","remaining_columns",")","corresponding","to","the","``","remainder","``","parameter",".","If","there","are","remaining","columns",",","then","``","len","(","transformers_",")","==len","(","transformers",")","+1","``",",","otherwise","``","len","(","transformers_",")","==len","(","transformers",")","``",".","named_transformers_",":",":","class",":","`","~sklearn.utils.Bunch","`","Read-only","attribute","to","access","any","transformer","by","given","name",".","Keys","are","transformer","names","and","values","are","the","fitted","transformer","objects",".","sparse_output_",":","bool","Boolean","flag","indicating","whether","the","output","of","``","transform","``","is","a","sparse","matrix","or","a","dense","numpy","array",",","which","depends","on","the","output","of","the","individual","transformers","and","the","`","sparse_threshold","`","keyword",".","output_indices_",":","dict","A","dictionary","from","each","transformer","name","to","a","slice",",","where","the","slice","corresponds","to","indices","in","the","transformed","output",".","This","is","useful","to","inspect","which","transformer","is","responsible","for","which","transformed","feature","(","s",")",".","..","versionadded",":",":","1.0","n_features_in_",":","int","Number","of","features","seen","during",":","term",":","`","fit","`",".","Only","defined","if","the","underlying","transformers","expose","such","an","attribute","when","fit",".","..","versionadded",":",":","0.24","feature_names_in_",":","ndarray","of","shape","(","`","n_features_in_","`",",",")","Names","of","features","seen","during",":","term",":","`","fit","`",".","Defined","only","when","`","X","`","has","feature","names","that","are","all","strings",".","..","versionadded",":",":","1.0","See","Also","--","--","--","--","make_column_transformer",":","Convenience","function","for","combining","the","outputs","of","multiple","transformer","objects","applied","to","column","subsets","of","the","original","feature","space",".","make_column_selector",":","Convenience","function","for","selecting","columns","based","on","datatype","or","the","columns","name","with","a","regex","pattern",".","Notes","--","--","-","The","order","of","the","columns","in","the","transformed","feature","matrix","follows","the","order","of","how","the","columns","are","specified","in","the","`","transformers","`","list",".","Columns","of","the","original","feature","matrix","that","are","not","specified","are","dropped","from","the","resulting","transformed","feature","matrix",",","unless","specified","in","the","`","passthrough","`","keyword",".","Those","columns","specified","with","`","passthrough","`","are","added","at","the","right","to","the","output","of","the","transformers",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","sklearn.compose","import","ColumnTransformer",">",">",">","from","sklearn.preprocessing","import","Normalizer",">",">",">","ct","=","ColumnTransformer","(","...","[","(","``","norm1","''",",","Normalizer","(","norm='l1","'",")",",","[","0",",","1","]",")",",","...","(","``","norm2","''",",","Normalizer","(","norm='l1","'",")",",","slice","(","2",",","4",")",")","]",")",">",">",">","X","=","np.array","(","[","[","0.",",","1.",",","2.",",","2",".","]",",","...","[","1.",",","1.",",","0.",",","1",".","]","]",")",">",">",">","#","Normalizer","scales","each","row","of","X","to","unit","norm",".","A","separate","scaling",">",">",">","#","is","applied","for","the","two","first","and","two","last","elements","of","each",">",">",">","#","row","independently",".",">",">",">","ct.fit_transform","(","X",")","array","(","[","[","0.",",","1.",",","0.5",",","0.5","]",",","[","0.5",",","0.5",",","0.",",","1",".","]","]",")",":","class",":","`","ColumnTransformer","`","can","be","configured","with","a","transformer","that","requires","a","1d","array","by","setting","the","column","to","a","string",":",">",">",">","from","sklearn.feature_extraction","import","FeatureHasher",">",">",">","from","sklearn.preprocessing","import","MinMaxScaler",">",">",">","import","pandas","as","pd","#","doctest",":","+SKIP",">",">",">","X","=","pd.DataFrame","(","{","...","``","documents","''",":","[","``","First","item","''",",","``","second","one","here","''",",","``","Is","this","the","last","?","``","]",",","...","``","width","''",":","[","3",",","4",",","5","]",",","...","}",")","#","doctest",":","+SKIP",">",">",">","#","``","documents","''","is","a","string","which","configures","ColumnTransformer","to",">",">",">","#","pass","the","documents","column","as","a","1d","array","to","the","FeatureHasher",">",">",">","ct","=","ColumnTransformer","(","...","[","(","``","text_preprocess","''",",","FeatureHasher","(","input_type=","''","string","''",")",",","``","documents","''",")",",","...","(","``","num_preprocess","''",",","MinMaxScaler","(",")",",","[","``","width","''","]",")","]",")",">",">",">","X_trans","=","ct.fit_transform","(","X",")","#","doctest",":","+SKIP","For","a","more","detailed","example","of","usage",",","see",":","ref",":","`","sphx_glr_auto_examples_compose_plot_column_transformer_mixed_types.py","`","."]
docstr: Validates ``remainder`` and defines ``_remainder`` targeting
  the remaining columns.
code: def _validate_remainder(self, X):
      """
      Validates ``remainder`` and defines ``_remainder`` targeting
      the remaining columns.
      """
      cols = set(chain(*self._transformer_to_input_indices.values()))
      remaining = sorted(set(range(self.n_features_in_)) - cols)
      self._remainder = ("remainder", self.remainder, remaining)
      self._transformer_to_input_indices["remainder"] = remaining
  
imports: import warnings
  from collections import Counter
  from itertools import chain
  from numbers import Integral, Real
  import numpy
  from scipy import sparse
  from ..base import TransformerMixin, _fit_context, clone
  from ..pipeline import _fit_transform_one, _name_estimators, _transform_one
  from ..preprocessing import FunctionTransformer
  from ..utils import Bunch, _get_column_indices, _safe_indexing
  from ..utils._estimator_html_repr import _VisualBlock
  from ..utils._metadata_requests import METHODS
  from ..utils._param_validation import HasMethods, Hidden, Interval, StrOptions
  from ..utils._set_output import _get_container_adapter, _get_output_config, _safe_set_output
  from ..utils.metadata_routing import MetadataRouter, MethodMapping, _raise_for_params, _routing_enabled, process_routing
  from ..utils.metaestimators import _BaseComposition
  from ..utils.parallel import Parallel, delayed
  from ..utils.validation import _check_feature_names_in, _get_feature_names, _is_pandas_df, _num_samples, check_array, check_is_fitted
label_desc: Use image node_id 10 for calling the ColumnTransformer obj's underlying member method code with example usage: obj._validate_remainder(X) without return types