class_docstr: Summary Encoding for categorical features.
  
  It's an encoder designed for creating richer representations by applying quantile encoding for a set of quantiles.
  
  Parameters
  ----------
  verbose: int
      integer indicating verbosity of the output. 0 for none.
  quantiles: list
      list of floats indicating the statistical quantiles. Each element represent a column
  m: float
      this is the “m” in the m-probability estimate. Higher value of m results into stronger shrinking. M is non-negative. 0 for no smoothing.
  cols: list
      a list of columns to encode, if None, all string columns will be encoded.
  drop_invariant: bool
      boolean for whether or not to drop columns with 0 variance.
  return_df: bool
      boolean for whether to return a pandas DataFrame from transform (otherwise it will be a numpy array).
  handle_missing: str
      options are 'error', 'return_nan'  and 'value', defaults to 'value', which returns the target quantile.
  handle_unknown: str
      options are 'error', 'return_nan' and 'value', defaults to 'value', which returns the target quantile.
  
  Example
  -------
  >>> from category_encoders import *
  >>> import pandas as pd
  >>> from sklearn.datasets import fetch_openml
  >>> bunch = fetch_openml(name="house_prices", as_frame=True)
  >>> display_cols = ["Id", "MSSubClass", "MSZoning", "LotFrontage", "YearBuilt", "Heating", "CentralAir"]
  >>> y = bunch.target
  >>> X = pd.DataFrame(bunch.data, columns=bunch.feature_names)[display_cols]
  >>> enc = SummaryEncoder(cols=["CentralAir", "Heating"], quantiles=[0.25, 0.5, 0.75]).fit(X, y)
  >>> numeric_dataset = enc.transform(X)
  >>> print(numeric_dataset.info())
  <class 'pandas.core.frame.DataFrame'>
  RangeIndex: 1460 entries, 0 to 1459
  Data columns (total 11 columns):
   #   Column         Non-Null Count  Dtype  
  ---  ------         --------------  -----  
   0   Id             1460 non-null   float64
   1   MSSubClass     1460 non-null   float64
   2   MSZoning       1460 non-null   object 
   3   LotFrontage    1201 non-null   float64
   4   YearBuilt      1460 non-null   float64
   5   Heating_25     1460 non-null   float64
   6   Heating_50     1460 non-null   float64
   7   Heating_75     1460 non-null   float64
   8   CentralAir_25  1460 non-null   float64
   9   CentralAir_50  1460 non-null   float64
   10  CentralAir_75  1460 non-null   float64
  dtypes: float64(10), object(1)
  memory usage: 125.6+ KB
  None
  
  References
  ----------
  .. [1] Quantile Encoder: Tackling High Cardinality Categorical Features in Regression Problems, https://link.springer.com/chapter/10.1007%2F978-3-030-85529-1_14
  .. [2] A Preprocessing Scheme for High-Cardinality Categorical Attributes in Classification and Prediction Problems, equation 7, from https://dl.acm.org/citation.cfm?id=507538
  .. [3] On estimating probabilities in tree pruning, equation 1, from https://link.springer.com/chapter/10.1007/BFb0017010
  .. [4] Additive smoothing, from https://en.wikipedia.org/wiki/Additive_smoothing#Generalized_to_the_case_of_known_incidence_rates
  .. [5] Target encoding done the right way https://maxhalford.github.io/blog/target-encoding/
class_docstr_tok: ["Summary","Encoding","for","categorical","features",".","It","'s","an","encoder","designed","for","creating","richer","representations","by","applying","quantile","encoding","for","a","set","of","quantiles",".","Parameters","--","--","--","--","--","verbose",":","int","integer","indicating","verbosity","of","the","output",".","0","for","none",".","quantiles",":","list","list","of","floats","indicating","the","statistical","quantiles",".","Each","element","represent","a","column","m",":","float","this","is","the","\u201c","m","\u201d","in","the","m-probability","estimate",".","Higher","value","of","m","results","into","stronger","shrinking",".","M","is","non-negative",".","0","for","no","smoothing",".","cols",":","list","a","list","of","columns","to","encode",",","if","None",",","all","string","columns","will","be","encoded",".","drop_invariant",":","bool","boolean","for","whether","or","not","to","drop","columns","with","0","variance",".","return_df",":","bool","boolean","for","whether","to","return","a","pandas","DataFrame","from","transform","(","otherwise","it","will","be","a","numpy","array",")",".","handle_missing",":","str","options","are","'error","'",",","'return_nan","'","and","'value","'",",","defaults","to","'value","'",",","which","returns","the","target","quantile",".","handle_unknown",":","str","options","are","'error","'",",","'return_nan","'","and","'value","'",",","defaults","to","'value","'",",","which","returns","the","target","quantile",".","Example","--","--","--","-",">",">",">","from","category_encoders","import","*",">",">",">","import","pandas","as","pd",">",">",">","from","sklearn.datasets","import","fetch_openml",">",">",">","bunch","=","fetch_openml","(","name=","''","house_prices","''",",","as_frame=True",")",">",">",">","display_cols","=","[","``","Id","''",",","``","MSSubClass","''",",","``","MSZoning","''",",","``","LotFrontage","''",",","``","YearBuilt","''",",","``","Heating","''",",","``","CentralAir","''","]",">",">",">","y","=","bunch.target",">",">",">","X","=","pd.DataFrame","(","bunch.data",",","columns=bunch.feature_names",")","[","display_cols","]",">",">",">","enc","=","SummaryEncoder","(","cols=","[","``","CentralAir","''",",","``","Heating","''","]",",","quantiles=","[","0.25",",","0.5",",","0.75","]",")",".fit","(","X",",","y",")",">",">",">","numeric_dataset","=","enc.transform","(","X",")",">",">",">","print","(","numeric_dataset.info","(",")",")","<","class","'pandas.core.frame.DataFrame","'",">","RangeIndex",":","1460","entries",",","0","to","1459","Data","columns","(","total","11","columns",")",":","#","Column","Non-Null","Count","Dtype","--","-","--","--","--","--","--","--","--","--","--","--","--","--","-","0","Id","1460","non-null","float64","1","MSSubClass","1460","non-null","float64","2","MSZoning","1460","non-null","object","3","LotFrontage","1201","non-null","float64","4","YearBuilt","1460","non-null","float64","5","Heating_25","1460","non-null","float64","6","Heating_50","1460","non-null","float64","7","Heating_75","1460","non-null","float64","8","CentralAir_25","1460","non-null","float64","9","CentralAir_50","1460","non-null","float64","10","CentralAir_75","1460","non-null","float64","dtypes",":","float64","(","10",")",",","object","(","1",")","memory","usage",":","125.6+","KB","None","References","--","--","--","--","--","..","[","1","]","Quantile","Encoder",":","Tackling","High","Cardinality","Categorical","Features","in","Regression","Problems",",","https",":","\/\/link.springer.com\/chapter\/10.1007","%","2F978-3-030-85529-1_14","..","[","2","]","A","Preprocessing","Scheme","for","High-Cardinality","Categorical","Attributes","in","Classification","and","Prediction","Problems",",","equation","7",",","from","https",":","\/\/dl.acm.org\/citation.cfm","?","id=507538","..","[","3","]","On","estimating","probabilities","in","tree","pruning",",","equation","1",",","from","https",":","\/\/link.springer.com\/chapter\/10.1007\/BFb0017010","..","[","4","]","Additive","smoothing",",","from","https",":","\/\/en.wikipedia.org\/wiki\/Additive_smoothing","#","Generalized_to_the_case_of_known_incidence_rates","..","[","5","]","Target","encoding","done","the","right","way","https",":","\/\/maxhalford.github.io\/blog\/target-encoding\/"]
code: def transform(self, X, y=None, override_return_df=False):
      if self.encoder_list is None:
          raise ValueError(
              "Must train encoder before it can be used to transform data."
          )
      X, y = util.convert_inputs(X, y)
  
      orig_cols = X.columns
      transformed_df = X.copy()
      for idx, encoder in enumerate(self.encoder_list):
          colname_mapping = {
              col: self._get_col_name(col, encoder.quantile)
              for col in self.cols
          }
          X_encoded = encoder.transform(X.copy()).rename(
              columns=colname_mapping
          )
          if idx == 0:
              transformed_df = X_encoded
          else:
              new_feat = X_encoded[
                  [c for c in X_encoded.columns if c not in orig_cols]
              ]
              transformed_df = pd.concat(
                  [transformed_df, new_feat], axis=1
              )
      feature_order = [
          c for c in self.get_feature_names_out() if c in transformed_df
      ]
      transformed_df = transformed_df[feature_order]
  
      if self.return_df or override_return_df:
          return transformed_df
      else:
          return transformed_df.to_numpy()
  
imports: from functools import reduce
  import operator
  from typing import List
  import warnings
  import numpy
  import pandas
  from sklearn.base import BaseEstimator
  from sklearn.exceptions import NotFittedError
  import category_encoders.utils
  from category_encoders.ordinal import OrdinalEncoder
label_desc: Use image node_id 3 for calling the SummaryEncoder obj's underlying member method code with example usage: obj.transform(X, y, override_return_df) and returns: transformed_df, transformed_df