class_docstr: Сlass for storing, cleaning and processing your dataset
class_docstr_tok: ["\u0421lass","for","storing",",","cleaning","and","processing","your","dataset"]
docstr: Description of _encode_features:
      Encode car features
  
  Args:
      data (pd.DataFrame):
      cat_encoder_name (str): cat Encoder name
  
  Returns:
      pd.DataFrame
docstr_tok: ["Description","of","_encode_features",":","Encode","car","features","Args",":","data","(","pd.DataFrame",")",":","cat_encoder_name","(","str",")",":","cat","Encoder","name","Returns",":","pd.DataFrame"]
code: def gen_target_encodet_features(
      self, x_data, y_data=None, cat_encoder_name=""
  ):
      """
      Description of _encode_features:
          Encode car features
  
      Args:
          data (pd.DataFrame):
          cat_encoder_name (str): cat Encoder name
  
      Returns:
          pd.DataFrame
  
      """
  
      if isinstance(cat_encoder_name, str):
          ### If it is the first time, it will perform fit_transform !
          if cat_encoder_name in self.target_encoders_names_list:
              encoder = self.target_encoders_names[cat_encoder_name][0](
                  cols=self.cat_features, drop_invariant=True
              )
              if settings.modeltype == "Multi_Classification":
                  ### you must put a Polynomial Wrapper on the cat_encoder in case the model is multi-class
                  if cat_encoder_name in ["WOEEncoder"]:
                      encoder = PolynomialWrapper(encoder)
              ### All other encoders TargetEncoder CatBoostEncoder GLMMEncoder don't need
              ### Polynomial Wrappers since they handle multi-class (label encoded) very well!
              cols = encoder.cols
              for each_col in cols:
                  x_data[each_col] = encoder.fit_transform(
                      x_data[each_col], y_data
                  ).values
              data_encodet = encoder.fit_transform(x_data, y_data)
              data_encodet = data_encodet.add_prefix(
                  cat_encoder_name + "_"
              )
          else:
              print(f"{cat_encoder_name} is not supported!")
              return ("", "")
      else:
          ### if it is already fit, then it will only do transform here !
          encoder = copy.deepcopy(cat_encoder_name)
          data_encodet = encoder.transform(x_data)
          data_encodet = data_encodet.add_prefix(
              str(cat_encoder_name).split("(")[0] + "_"
          )
  
      return (data_encodet, encoder)
  
imports: import pandas
  import numpy
  from itertools import combinations
  from sklearn.preprocessing import StandardScaler
  from category_encoders import HashingEncoder, SumEncoder, PolynomialEncoder, BackwardDifferenceEncoder
  from category_encoders import OneHotEncoder, HelmertEncoder, OrdinalEncoder, CountEncoder, BaseNEncoder
  from category_encoders import TargetEncoder, CatBoostEncoder, WOEEncoder, JamesSteinEncoder
  from category_encoders.glmm import GLMMEncoder
  from sklearn.preprocessing import LabelEncoder
  from category_encoders.wrapper import PolynomialWrapper
  from .encoders import FrequencyEncoder
  from .None import settings
  import pdb
  import copy
  import dask
  import dask.dataframe
label_desc: Use image node_id 6 for calling the DataBunch obj's underlying member method code with example usage: obj.gen_target_encodet_features(x_data, y_data, cat_encoder_name) and returns: data_encodet,  encoder, str,  str