class_docstr: Extend supervised encoders to n-class labels, where n >= 2.
  
  The label can be numerical (e.g.: 0, 1, 2, 3,...,n), string or categorical (pandas.Categorical).
  The label is first encoded into n-1 binary columns. Subsequently, the inner supervised encoder
  is executed for each binarized label.
  
  The names of the encoded features are suffixed with underscore and the corresponding class name
  (edge scenarios like 'dog'+'cat_frog' vs. 'dog_cat'+'frog' are not currently handled).
  
  The implementation is experimental and the API may change in the future.
  The order of the returned features may change in the future.
  
  
  Parameters
  ----------
  
  feature_encoder: Object
      an instance of a supervised encoder.
  
  
  Example
  -------
  >>> from category_encoders import *
  >>> import pandas as pd
  >>> from sklearn.datasets import fetch_openml
  >>> from category_encoders.wrapper import PolynomialWrapper
  >>> display_cols = ["Id", "MSSubClass", "MSZoning", "LotFrontage", "YearBuilt", "Heating", "CentralAir"]
  >>> bunch = fetch_openml(name="house_prices", as_frame=True)
  >>> # need more than one column
  >>> y = bunch.target.map(lambda x: int(min([x, 300000])/50000))
  >>> X = pd.DataFrame(bunch.data, columns=bunch.feature_names)[display_cols]
  >>> enc = TargetEncoder(cols=['CentralAir', 'Heating'])
  >>> wrapper = PolynomialWrapper(enc)
  >>> encoded = wrapper.fit_transform(X, y)
  >>> print(encoded.info())
  <class 'pandas.core.frame.DataFrame'>
  RangeIndex: 1460 entries, 0 to 1459
  Data columns (total 17 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   CentralAir_3  1460 non-null   float64
   6   Heating_3     1460 non-null   float64
   7   CentralAir_2  1460 non-null   float64
   8   Heating_2     1460 non-null   float64
   9   CentralAir_5  1460 non-null   float64
   10  Heating_5     1460 non-null   float64
   11  CentralAir_6  1460 non-null   float64
   12  Heating_6     1460 non-null   float64
   13  CentralAir_1  1460 non-null   float64
   14  Heating_1     1460 non-null   float64
   15  CentralAir_0  1460 non-null   float64
   16  Heating_0     1460 non-null   float64
  dtypes: float64(16), object(1)
  memory usage: 194.0+ KB
  None
class_docstr_tok: ["Extend","supervised","encoders","to","n-class","labels",",","where","n",">","=","2",".","The","label","can","be","numerical","(","e.g",".",":","0",",","1",",","2",",","3",",","...",",","n",")",",","string","or","categorical","(","pandas.Categorical",")",".","The","label","is","first","encoded","into","n-1","binary","columns",".","Subsequently",",","the","inner","supervised","encoder","is","executed","for","each","binarized","label",".","The","names","of","the","encoded","features","are","suffixed","with","underscore","and","the","corresponding","class","name","(","edge","scenarios","like","'dog'+'cat_frog","'","vs.","'dog_cat'+'frog","'","are","not","currently","handled",")",".","The","implementation","is","experimental","and","the","API","may","change","in","the","future",".","The","order","of","the","returned","features","may","change","in","the","future",".","Parameters","--","--","--","--","--","feature_encoder",":","Object","an","instance","of","a","supervised","encoder",".","Example","--","--","--","-",">",">",">","from","category_encoders","import","*",">",">",">","import","pandas","as","pd",">",">",">","from","sklearn.datasets","import","fetch_openml",">",">",">","from","category_encoders.wrapper","import","PolynomialWrapper",">",">",">","display_cols","=","[","``","Id","''",",","``","MSSubClass","''",",","``","MSZoning","''",",","``","LotFrontage","''",",","``","YearBuilt","''",",","``","Heating","''",",","``","CentralAir","''","]",">",">",">","bunch","=","fetch_openml","(","name=","''","house_prices","''",",","as_frame=True",")",">",">",">","#","need","more","than","one","column",">",">",">","y","=","bunch.target.map","(","lambda","x",":","int","(","min","(","[","x",",","300000","]",")","\/50000",")",")",">",">",">","X","=","pd.DataFrame","(","bunch.data",",","columns=bunch.feature_names",")","[","display_cols","]",">",">",">","enc","=","TargetEncoder","(","cols=","[","'CentralAir","'",",","'Heating","'","]",")",">",">",">","wrapper","=","PolynomialWrapper","(","enc",")",">",">",">","encoded","=","wrapper.fit_transform","(","X",",","y",")",">",">",">","print","(","encoded.info","(",")",")","<","class","'pandas.core.frame.DataFrame","'",">","RangeIndex",":","1460","entries",",","0","to","1459","Data","columns","(","total","17","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","CentralAir_3","1460","non-null","float64","6","Heating_3","1460","non-null","float64","7","CentralAir_2","1460","non-null","float64","8","Heating_2","1460","non-null","float64","9","CentralAir_5","1460","non-null","float64","10","Heating_5","1460","non-null","float64","11","CentralAir_6","1460","non-null","float64","12","Heating_6","1460","non-null","float64","13","CentralAir_1","1460","non-null","float64","14","Heating_1","1460","non-null","float64","15","CentralAir_0","1460","non-null","float64","16","Heating_0","1460","non-null","float64","dtypes",":","float64","(","16",")",",","object","(","1",")","memory","usage",":","194.0+","KB","None"]
code: def fit(self, X, y, **kwargs):
      # unite the input into pandas types
      X, y = utils.convert_inputs(X, y)
      y = pd.DataFrame(y.rename("target"))
  
      # apply one-hot-encoder on the label
      self.label_encoder = encoders.OneHotEncoder(
          handle_missing="error",
          handle_unknown="error",
          cols=["target"],
          drop_invariant=True,
          use_cat_names=True,
      )
      labels = self.label_encoder.fit_transform(y)
      labels.columns = [column[7:] for column in labels.columns]
      labels = labels.iloc[:, 1:]  # drop one label
  
      # train the feature encoders, it is important to reset feature encoders first
      self.feature_encoders = {}
      for class_name, label in labels.items():
          self.feature_encoders[class_name] = copy.deepcopy(
              self.feature_encoder
          ).fit(X, label)
  
imports: import copy
  from category_encoders import utils
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.model_selection import StratifiedKFold
  import category_encoders
  import pandas
  from typing import Dict, Optional
label_desc: Use image node_id 2 for calling the PolynomialWrapper obj's underlying member method code with example usage: obj.fit(X, y) without return types