docstr: This function initializes the training environment and creates the transformation
  pipeline. Setup function must be called before executing any other function. It
  takes one mandatory parameter: ``data``. All the other parameters are optional.
  
  
  Example
  -------
  >>> from pycaret.datasets import get_data
  >>> jewellery = get_data('jewellery')
  >>> from pycaret.clustering import *
  >>> exp_name = setup(data = jewellery)
  
  
  data: dataframe-like
      Data set with shape (n_samples, n_features), where n_samples is the
      number of samples and n_features is the number of features. If data
      is not a pandas dataframe, it's converted to one using default column
      names.
  
  
  data_func: Callable[[], DATAFRAME_LIKE] = None
      The function that generate ``data`` (the dataframe-like input). This
      is useful when the dataset is large, and you need parallel operations
      such as ``compare_models``. It can avoid broadcasting large dataset
      from driver to workers. Notice one and only one of ``data`` and
      ``data_func`` must be set.
  
  index: bool, int, str or sequence, default = True
      Handle indices in the `data` dataframe.
          - If False: Reset to RangeIndex.
          - If True: Keep the provided index.
          - If int: Position of the column to use as index.
          - If str: Name of the column to use as index.
          - If sequence: Array with shape=(n_samples,) to use as index.
  
  
  ordinal_features: dict, default = None
      Categorical features to be encoded ordinally. For example, a categorical
      feature with 'low', 'medium', 'high' values where low < medium < high can
      be passed as ordinal_features = {'column_name' : ['low', 'medium', 'high']}.
  
  
  numeric_features: list of str, default = None
      If the inferred data types are not correct, the numeric_features param can
      be used to define the data types. It takes a list of strings with column
      names that are numeric.
  
  
  categorical_features: list of str, default = None
      If the inferred data types are not correct, the categorical_features param
      can be used to define the data types. It takes a list of strings with column
      names that are categorical.
  
  
  date_features: list of str, default = None
      If the inferred data types are not correct, the date_features param can be
      used to overwrite the data types. It takes a list of strings with column
      names that are DateTime.
  
  
  text_features: list of str, default = None
      Column names that contain a text corpus. If None, no text features are
      selected.
  
  
  ignore_features: list of str, default = None
      ignore_features param can be used to ignore features during preprocessing
      and model training. It takes a list of strings with column names that are
      to be ignored.
  
  
  keep_features: list of str, default = None
      keep_features param can be used to always keep specific features during
      preprocessing, i.e. these features are never dropped by any kind of
      feature selection. It takes a list of strings with column names that are
      to be kept.
  
  
  preprocess: bool, default = True
      When set to False, no transformations are applied except for train_test_split
      and custom transformations passed in ``custom_pipeline`` param. Data must be
      ready for modeling (no missing values, no dates, categorical data encoding),
      when preprocess is set to False.
  
  
  create_date_columns: list of str, default = ["day", "month", "year"]
      Columns to create from the date features. Note that created features
      with zero variance (e.g. the feature hour in a column that only contains
      dates) are ignored. Allowed values are datetime attributes from
      `pandas.Series.dt`. The datetime format of the feature is inferred
      automatically from the first non NaN value.
  
  
  imputation_type: str or None, default = 'simple'
      The type of imputation to use. Unsupervised learning only supports
      'imputation_type=simple'. If None, no imputation of missing values
      is performed.
  
  
  numeric_imputation: str, default = 'mean'
      Missing values in numeric features are imputed with 'mean' value of the feature
      in the training dataset. The other available option is 'median' or 'zero'.
  
  
  categorical_imputation: str, default = 'constant'
      Missing values in categorical features are imputed with a constant 'not_available'
      value. The other available option is 'mode'.
  
  
  text_features_method: str, default = "tf-idf"
      Method with which to embed the text features in the dataset. Choose
      between "bow" (Bag of Words - CountVectorizer) or "tf-idf" (TfidfVectorizer).
      Be aware that the sparse matrix output of the transformer is converted
      internally to its full array. This can cause memory issues for large
      text embeddings.
  
  
  max_encoding_ohe: int, default = -1
      Categorical columns with `max_encoding_ohe` or less unique values are
      encoded using OneHotEncoding. If more, the `encoding_method` estimator
      is used. Note that columns with exactly two classes are always encoded
      ordinally. Set to below 0 to always use OneHotEncoding.
  
  
  encoding_method: category-encoders estimator, default = None
      A `category-encoders` estimator to encode the categorical columns
      with more than `max_encoding_ohe` unique values. If None,
      `category_encoders.basen.BaseN` is used.
  
  
  rare_to_value: float or None, default=None
      Minimum fraction of category occurrences in a categorical column.
      If a category is less frequent than `rare_to_value * len(X)`, it is
      replaced with the string in `rare_value`. Use this parameter to group
      rare categories before encoding the column. If None, ignores this step.
  
  
  rare_value: str, default="rare"
      Value with which to replace rare categories. Ignored when
      ``rare_to_value`` is None.
  
  
  polynomial_features: bool, default = False
      When set to True, new features are derived using existing numeric features.
  
  
  polynomial_degree: int, default = 2
      Degree of polynomial features. For example, if an input sample is two dimensional
      and of the form [a, b], the polynomial features with degree = 2 are:
      [1, a, b, a^2, ab, b^2]. Ignored when ``polynomial_features`` is not True.
  
  
  low_variance_threshold: float or None, default = None
      Remove features with a training-set variance lower than the provided
      threshold. If 0, keep all features with non-zero variance, i.e. remove
      the features that have the same value in all samples. If None, skip
      this transformation step.
  
  
  group_features: dict or None, default = None
      When the dataset contains features with related characteristics,
      add new fetaures with the following statistical properties of that
      group: min, max, mean, std, median and mode. The parameter takes a
      dict with the group name as key and a list of feature names
      belonging to that group as value.
  
  
  drop_groups: bool, default=False
      Whether to drop the original features in the group. Ignored when
      ``group_features`` is None.
  
  
  remove_multicollinearity: bool, default = False
      When set to True, features with the inter-correlations higher than
      the defined threshold are removed. For each group, it removes all
      except the first feature.
  
  
  multicollinearity_threshold: float, default = 0.9
      Minimum absolute Pearson correlation to identify correlated
      features. The default value removes equal columns. Ignored when
      ``remove_multicollinearity`` is not True.
  
  
  bin_numeric_features: list of str, default = None
      To convert numeric features into categorical, bin_numeric_features parameter can
      be used. It takes a list of strings with column names to be discretized. It does
      so by using 'sturges' rule to determine the number of clusters and then apply
      KMeans algorithm. Original values of the feature are then replaced by the
      cluster label.
  
  
  remove_outliers: bool, default = False
      When set to True, outliers from the training data are removed using an
      Isolation Forest.
  
  
  outliers_method: str, default = "iforest"
      Method with which to remove outliers. Possible values are:
          - 'iforest': Uses sklearn's IsolationForest.
          - 'ee': Uses sklearn's EllipticEnvelope.
          - 'lof': Uses sklearn's LocalOutlierFactor.
  
  
  outliers_threshold: float, default = 0.05
      The percentage outliers to be removed from the dataset. Ignored
      when ``remove_outliers=False``.
  
  
  transformation: bool, default = False
      When set to True, it applies the power transform to make data more Gaussian-like.
      Type of transformation is defined by the ``transformation_method`` parameter.
  
  
  transformation_method: str, default = 'yeo-johnson'
      Defines the method for transformation. By default, the transformation method is
      set to 'yeo-johnson'. The other available option for transformation is 'quantile'.
      Ignored when ``transformation`` is not True.
  
  
  normalize: bool, default = False
      When set to True, it transforms the features by scaling them to a given
      range. Type of scaling is defined by the ``normalize_method`` parameter.
  
  
  normalize_method: str, default = 'zscore'
      Defines the method for scaling. By default, normalize method is set to 'zscore'
      The standard zscore is calculated as z = (x - u) / s. Ignored when ``normalize``
      is not True. The other options are:
  
      - minmax: scales and translates each feature individually such that it is in
      the range of 0 - 1.
      - maxabs: scales and translates each feature individually such that the
      maximal absolute value of each feature will be 1.0. It does not
      shift/center the data, and thus does not destroy any sparsity.
      - robust: scales and translates each feature according to the Interquartile
      range. When the dataset contains outliers, robust scaler often gives
      better results.
  
  
  pca: bool, default = False
      When set to True, dimensionality reduction is applied to project the data into
      a lower dimensional space using the method defined in ``pca_method`` parameter.
  
  
  pca_method: str, default = 'linear'
      Method with which to apply PCA. Possible values are:
          - 'linear': Uses Singular Value  Decomposition.
          - 'kernel': Dimensionality reduction through the use of RBF kernel.
          - 'incremental': Similar to 'linear', but more efficient for large datasets.
  
  
  pca_components: int, float, str or None, default = None
      Number of components to keep. This parameter is ignored when `pca=False`.
          - If None: All components are kept.
          - If int: Absolute number of components.
          - If float: Such an amount that the variance that needs to be explained
                      is greater than the percentage specified by `n_components`.
                      Value should lie between 0 and 1 (ony for pca_method='linear').
          - If "mle": Minka’s MLE is used to guess the dimension (ony for pca_method='linear').
  
  
  custom_pipeline: list of (str, transformer), dict or Pipeline, default = None
      Addidiotnal custom transformers. If passed, they are applied to the
      pipeline last, after all the build-in transformers.
  
  
  custom_pipeline_position: int, default = -1
      Position of the custom pipeline in the overal preprocessing pipeline.
      The default value adds the custom pipeline last.
  
  
  n_jobs: int, default = -1
      The number of jobs to run in parallel (for functions that supports parallel
      processing) -1 means using all processors. To run all functions on single
      processor set n_jobs to None.
  
  
  use_gpu: bool or str, default = False
      When set to True, it will use GPU for training with algorithms that support it,
      and fall back to CPU if they are unavailable. When set to 'force', it will only
      use GPU-enabled algorithms and raise exceptions when they are unavailable. When
      False, all algorithms are trained using CPU only.
  
      GPU enabled algorithms:
  
      - None at this moment.
  
  
  html: bool, default = True
      When set to False, prevents runtime display of monitor. This must be set to False
      when the environment does not support IPython. For example, command line terminal,
      Databricks Notebook, Spyder and other similar IDEs.
  
  
  session_id: int, default = None
      Controls the randomness of experiment. It is equivalent to 'random_state' in
      scikit-learn. When None, a pseudo random number is generated. This can be used
      for later reproducibility of the entire experiment.
  
  
  system_log: bool or str or logging.Logger, default = True
      Whether to save the system logging file (as logs.log). If the input
      is a string, use that as the path to the logging file. If the input
      already is a logger object, use that one instead.
  
  
  log_experiment: bool, default = False
      A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb', 'comet_ml')
      corresponding to a logger to determine which experiment loggers to use.
      Setting to True will use just MLFlow.
      If ``wandb`` (Weights & Biases) or ``comet_ml``is installed, will also log there.
  
  
  experiment_name: str, default = None
      Name of the experiment for logging. Ignored when ``log_experiment`` is False.
  
  
  experiment_custom_tags: dict, default = None
      Dictionary of tag_name: String -> value: (String, but will be string-ified
      if not) passed to the mlflow.set_tags to add new custom tags for the experiment.
  
  
  log_plots: bool or list, default = False
      When set to True, certain plots are logged automatically in the ``MLFlow`` server.
      To change the type of plots to be logged, pass a list containing plot IDs. Refer
      to documentation of ``plot_model``. Ignored when ``log_experiment`` is False.
  
  
  log_profile: bool, default = False
      When set to True, data profile is logged on the ``MLflow`` server as a html file.
      Ignored when ``log_experiment`` is False.
  
  
  log_data: bool, default = False
      When set to True, dataset is logged on the ``MLflow`` server as a csv file.
      Ignored when ``log_experiment`` is False.
  
  
  verbose: bool, default = True
      When set to False, Information grid is not printed.
  
  
  memory: str, bool or Memory, default=True
      Used to cache the fitted transformers of the pipeline.
          If False: No caching is performed.
          If True: A default temp directory is used.
          If str: Path to the caching directory.
  
  
  profile: bool, default = False
      When set to True, an interactive EDA report is displayed.
  
  
  profile_kwargs: dict, default = {} (empty dict)
      Dictionary of arguments passed to the ProfileReport method used
      to create the EDA report. Ignored if ``profile`` is False.
  
  
  Returns:
      Global variables that can be changed using the ``set_config`` function.
docstr_tok: ["This","function","initializes","the","training","environment","and","creates","the","transformation","pipeline",".","Setup","function","must","be","called","before","executing","any","other","function",".","It","takes","one","mandatory","parameter",":","``","data","``",".","All","the","other","parameters","are","optional",".","Example","--","--","--","-",">",">",">","from","pycaret.datasets","import","get_data",">",">",">","jewellery","=","get_data","(","'jewellery","'",")",">",">",">","from","pycaret.clustering","import","*",">",">",">","exp_name","=","setup","(","data","=","jewellery",")","data",":","dataframe-like","Data","set","with","shape","(","n_samples",",","n_features",")",",","where","n_samples","is","the","number","of","samples","and","n_features","is","the","number","of","features",".","If","data","is","not","a","pandas","dataframe",",","it","'s","converted","to","one","using","default","column","names",".","data_func",":","Callable","[","[","]",",","DATAFRAME_LIKE","]","=","None","The","function","that","generate","``","data","``","(","the","dataframe-like","input",")",".","This","is","useful","when","the","dataset","is","large",",","and","you","need","parallel","operations","such","as","``","compare_models","``",".","It","can","avoid","broadcasting","large","dataset","from","driver","to","workers",".","Notice","one","and","only","one","of","``","data","``","and","``","data_func","``","must","be","set",".","index",":","bool",",","int",",","str","or","sequence",",","default","=","True","Handle","indices","in","the","`","data","`","dataframe",".","-","If","False",":","Reset","to","RangeIndex",".","-","If","True",":","Keep","the","provided","index",".","-","If","int",":","Position","of","the","column","to","use","as","index",".","-","If","str",":","Name","of","the","column","to","use","as","index",".","-","If","sequence",":","Array","with","shape=","(","n_samples",",",")","to","use","as","index",".","ordinal_features",":","dict",",","default","=","None","Categorical","features","to","be","encoded","ordinally",".","For","example",",","a","categorical","feature","with","'low","'",",","'medium","'",",","'high","'","values","where","low","<","medium","<","high","can","be","passed","as","ordinal_features","=","{","'column_name","'",":","[","'low","'",",","'medium","'",",","'high","'","]","}",".","numeric_features",":","list","of","str",",","default","=","None","If","the","inferred","data","types","are","not","correct",",","the","numeric_features","param","can","be","used","to","define","the","data","types",".","It","takes","a","list","of","strings","with","column","names","that","are","numeric",".","categorical_features",":","list","of","str",",","default","=","None","If","the","inferred","data","types","are","not","correct",",","the","categorical_features","param","can","be","used","to","define","the","data","types",".","It","takes","a","list","of","strings","with","column","names","that","are","categorical",".","date_features",":","list","of","str",",","default","=","None","If","the","inferred","data","types","are","not","correct",",","the","date_features","param","can","be","used","to","overwrite","the","data","types",".","It","takes","a","list","of","strings","with","column","names","that","are","DateTime",".","text_features",":","list","of","str",",","default","=","None","Column","names","that","contain","a","text","corpus",".","If","None",",","no","text","features","are","selected",".","ignore_features",":","list","of","str",",","default","=","None","ignore_features","param","can","be","used","to","ignore","features","during","preprocessing","and","model","training",".","It","takes","a","list","of","strings","with","column","names","that","are","to","be","ignored",".","keep_features",":","list","of","str",",","default","=","None","keep_features","param","can","be","used","to","always","keep","specific","features","during","preprocessing",",","i.e",".","these","features","are","never","dropped","by","any","kind","of","feature","selection",".","It","takes","a","list","of","strings","with","column","names","that","are","to","be","kept",".","preprocess",":","bool",",","default","=","True","When","set","to","False",",","no","transformations","are","applied","except","for","train_test_split","and","custom","transformations","passed","in","``","custom_pipeline","``","param",".","Data","must","be","ready","for","modeling","(","no","missing","values",",","no","dates",",","categorical","data","encoding",")",",","when","preprocess","is","set","to","False",".","create_date_columns",":","list","of","str",",","default","=","[","``","day","''",",","``","month","''",",","``","year","''","]","Columns","to","create","from","the","date","features",".","Note","that","created","features","with","zero","variance","(","e.g",".","the","feature","hour","in","a","column","that","only","contains","dates",")","are","ignored",".","Allowed","values","are","datetime","attributes","from","`","pandas.Series.dt","`",".","The","datetime","format","of","the","feature","is","inferred","automatically","from","the","first","non","NaN","value",".","imputation_type",":","str","or","None",",","default","=","'simple'","The","type","of","imputation","to","use",".","Unsupervised","learning","only","supports","'imputation_type=simple","'",".","If","None",",","no","imputation","of","missing","values","is","performed",".","numeric_imputation",":","str",",","default","=","'mean'","Missing","values","in","numeric","features","are","imputed","with","'mean","'","value","of","the","feature","in","the","training","dataset",".","The","other","available","option","is","'median","'","or","'zero","'",".","categorical_imputation",":","str",",","default","=","'constant'","Missing","values","in","categorical","features","are","imputed","with","a","constant","'not_available'","value",".","The","other","available","option","is","'mode","'",".","text_features_method",":","str",",","default","=","``","tf-idf","''","Method","with","which","to","embed","the","text","features","in","the","dataset",".","Choose","between","``","bow","''","(","Bag","of","Words","-","CountVectorizer",")","or","``","tf-idf","''","(","TfidfVectorizer",")",".","Be","aware","that","the","sparse","matrix","output","of","the","transformer","is","converted","internally","to","its","full","array",".","This","can","cause","memory","issues","for","large","text","embeddings",".","max_encoding_ohe",":","int",",","default","=","-1","Categorical","columns","with","`","max_encoding_ohe","`","or","less","unique","values","are","encoded","using","OneHotEncoding",".","If","more",",","the","`","encoding_method","`","estimator","is","used",".","Note","that","columns","with","exactly","two","classes","are","always","encoded","ordinally",".","Set","to","below","0","to","always","use","OneHotEncoding",".","encoding_method",":","category-encoders","estimator",",","default","=","None","A","`","category-encoders","`","estimator","to","encode","the","categorical","columns","with","more","than","`","max_encoding_ohe","`","unique","values",".","If","None",",","`","category_encoders.basen.BaseN","`","is","used",".","rare_to_value",":","float","or","None",",","default=None","Minimum","fraction","of","category","occurrences","in","a","categorical","column",".","If","a","category","is","less","frequent","than","`","rare_to_value","*","len","(","X",")","`",",","it","is","replaced","with","the","string","in","`","rare_value","`",".","Use","this","parameter","to","group","rare","categories","before","encoding","the","column",".","If","None",",","ignores","this","step",".","rare_value",":","str",",","default=","''","rare","''","Value","with","which","to","replace","rare","categories",".","Ignored","when","``","rare_to_value","``","is","None",".","polynomial_features",":","bool",",","default","=","False","When","set","to","True",",","new","features","are","derived","using","existing","numeric","features",".","polynomial_degree",":","int",",","default","=","2","Degree","of","polynomial","features",".","For","example",",","if","an","input","sample","is","two","dimensional","and","of","the","form","[","a",",","b","]",",","the","polynomial","features","with","degree","=","2","are",":","[","1",",","a",",","b",",","a^2",",","ab",",","b^2","]",".","Ignored","when","``","polynomial_features","``","is","not","True",".","low_variance_threshold",":","float","or","None",",","default","=","None","Remove","features","with","a","training-set","variance","lower","than","the","provided","threshold",".","If","0",",","keep","all","features","with","non-zero","variance",",","i.e",".","remove","the","features","that","have","the","same","value","in","all","samples",".","If","None",",","skip","this","transformation","step",".","group_features",":","dict","or","None",",","default","=","None","When","the","dataset","contains","features","with","related","characteristics",",","add","new","fetaures","with","the","following","statistical","properties","of","that","group",":","min",",","max",",","mean",",","std",",","median","and","mode",".","The","parameter","takes","a","dict","with","the","group","name","as","key","and","a","list","of","feature","names","belonging","to","that","group","as","value",".","drop_groups",":","bool",",","default=False","Whether","to","drop","the","original","features","in","the","group",".","Ignored","when","``","group_features","``","is","None",".","remove_multicollinearity",":","bool",",","default","=","False","When","set","to","True",",","features","with","the","inter-correlations","higher","than","the","defined","threshold","are","removed",".","For","each","group",",","it","removes","all","except","the","first","feature",".","multicollinearity_threshold",":","float",",","default","=","0.9","Minimum","absolute","Pearson","correlation","to","identify","correlated","features",".","The","default","value","removes","equal","columns",".","Ignored","when","``","remove_multicollinearity","``","is","not","True",".","bin_numeric_features",":","list","of","str",",","default","=","None","To","convert","numeric","features","into","categorical",",","bin_numeric_features","parameter","can","be","used",".","It","takes","a","list","of","strings","with","column","names","to","be","discretized",".","It","does","so","by","using","'sturges","'","rule","to","determine","the","number","of","clusters","and","then","apply","KMeans","algorithm",".","Original","values","of","the","feature","are","then","replaced","by","the","cluster","label",".","remove_outliers",":","bool",",","default","=","False","When","set","to","True",",","outliers","from","the","training","data","are","removed","using","an","Isolation","Forest",".","outliers_method",":","str",",","default","=","``","iforest","''","Method","with","which","to","remove","outliers",".","Possible","values","are",":","-","'iforest","'",":","Uses","sklearn","'s","IsolationForest",".","-","'ee","'",":","Uses","sklearn","'s","EllipticEnvelope",".","-","'lof","'",":","Uses","sklearn","'s","LocalOutlierFactor",".","outliers_threshold",":","float",",","default","=","0.05","The","percentage","outliers","to","be","removed","from","the","dataset",".","Ignored","when","``","remove_outliers=False","``",".","transformation",":","bool",",","default","=","False","When","set","to","True",",","it","applies","the","power","transform","to","make","data","more","Gaussian-like",".","Type","of","transformation","is","defined","by","the","``","transformation_method","``","parameter",".","transformation_method",":","str",",","default","=","'yeo-johnson'","Defines","the","method","for","transformation",".","By","default",",","the","transformation","method","is","set","to","'yeo-johnson","'",".","The","other","available","option","for","transformation","is","'quantile","'",".","Ignored","when","``","transformation","``","is","not","True",".","normalize",":","bool",",","default","=","False","When","set","to","True",",","it","transforms","the","features","by","scaling","them","to","a","given","range",".","Type","of","scaling","is","defined","by","the","``","normalize_method","``","parameter",".","normalize_method",":","str",",","default","=","'zscore'","Defines","the","method","for","scaling",".","By","default",",","normalize","method","is","set","to","'zscore'","The","standard","zscore","is","calculated","as","z","=","(","x","-","u",")","\/","s.","Ignored","when","``","normalize","``","is","not","True",".","The","other","options","are",":","-","minmax",":","scales","and","translates","each","feature","individually","such","that","it","is","in","the","range","of","0","-","1",".","-","maxabs",":","scales","and","translates","each","feature","individually","such","that","the","maximal","absolute","value","of","each","feature","will","be","1.0",".","It","does","not","shift\/center","the","data",",","and","thus","does","not","destroy","any","sparsity",".","-","robust",":","scales","and","translates","each","feature","according","to","the","Interquartile","range",".","When","the","dataset","contains","outliers",",","robust","scaler","often","gives","better","results",".","pca",":","bool",",","default","=","False","When","set","to","True",",","dimensionality","reduction","is","applied","to","project","the","data","into","a","lower","dimensional","space","using","the","method","defined","in","``","pca_method","``","parameter",".","pca_method",":","str",",","default","=","'linear'","Method","with","which","to","apply","PCA",".","Possible","values","are",":","-","'linear","'",":","Uses","Singular","Value","Decomposition",".","-","'kernel","'",":","Dimensionality","reduction","through","the","use","of","RBF","kernel",".","-","'incremental","'",":","Similar","to","'linear","'",",","but","more","efficient","for","large","datasets",".","pca_components",":","int",",","float",",","str","or","None",",","default","=","None","Number","of","components","to","keep",".","This","parameter","is","ignored","when","`","pca=False","`",".","-","If","None",":","All","components","are","kept",".","-","If","int",":","Absolute","number","of","components",".","-","If","float",":","Such","an","amount","that","the","variance","that","needs","to","be","explained","is","greater","than","the","percentage","specified","by","`","n_components","`",".","Value","should","lie","between","0","and","1","(","ony","for","pca_method='linear","'",")",".","-","If","``","mle","''",":","Minka","\u2019","s","MLE","is","used","to","guess","the","dimension","(","ony","for","pca_method='linear","'",")",".","custom_pipeline",":","list","of","(","str",",","transformer",")",",","dict","or","Pipeline",",","default","=","None","Addidiotnal","custom","transformers",".","If","passed",",","they","are","applied","to","the","pipeline","last",",","after","all","the","build-in","transformers",".","custom_pipeline_position",":","int",",","default","=","-1","Position","of","the","custom","pipeline","in","the","overal","preprocessing","pipeline",".","The","default","value","adds","the","custom","pipeline","last",".","n_jobs",":","int",",","default","=","-1","The","number","of","jobs","to","run","in","parallel","(","for","functions","that","supports","parallel","processing",")","-1","means","using","all","processors",".","To","run","all","functions","on","single","processor","set","n_jobs","to","None",".","use_gpu",":","bool","or","str",",","default","=","False","When","set","to","True",",","it","will","use","GPU","for","training","with","algorithms","that","support","it",",","and","fall","back","to","CPU","if","they","are","unavailable",".","When","set","to","'force","'",",","it","will","only","use","GPU-enabled","algorithms","and","raise","exceptions","when","they","are","unavailable",".","When","False",",","all","algorithms","are","trained","using","CPU","only",".","GPU","enabled","algorithms",":","-","None","at","this","moment",".","html",":","bool",",","default","=","True","When","set","to","False",",","prevents","runtime","display","of","monitor",".","This","must","be","set","to","False","when","the","environment","does","not","support","IPython",".","For","example",",","command","line","terminal",",","Databricks","Notebook",",","Spyder","and","other","similar","IDEs",".","session_id",":","int",",","default","=","None","Controls","the","randomness","of","experiment",".","It","is","equivalent","to","'random_state","'","in","scikit-learn",".","When","None",",","a","pseudo","random","number","is","generated",".","This","can","be","used","for","later","reproducibility","of","the","entire","experiment",".","system_log",":","bool","or","str","or","logging.Logger",",","default","=","True","Whether","to","save","the","system","logging","file","(","as","logs.log",")",".","If","the","input","is","a","string",",","use","that","as","the","path","to","the","logging","file",".","If","the","input","already","is","a","logger","object",",","use","that","one","instead",".","log_experiment",":","bool",",","default","=","False","A","(","list","of",")","PyCaret","``","BaseLogger","``","or","str","(","one","of","'mlflow","'",",","'wandb","'",",","'comet_ml","'",")","corresponding","to","a","logger","to","determine","which","experiment","loggers","to","use",".","Setting","to","True","will","use","just","MLFlow",".","If","``","wandb","``","(","Weights","&","Biases",")","or","``","comet_ml","``","is","installed",",","will","also","log","there",".","experiment_name",":","str",",","default","=","None","Name","of","the","experiment","for","logging",".","Ignored","when","``","log_experiment","``","is","False",".","experiment_custom_tags",":","dict",",","default","=","None","Dictionary","of","tag_name",":","String","-",">","value",":","(","String",",","but","will","be","string-ified","if","not",")","passed","to","the","mlflow.set_tags","to","add","new","custom","tags","for","the","experiment",".","log_plots",":","bool","or","list",",","default","=","False","When","set","to","True",",","certain","plots","are","logged","automatically","in","the","``","MLFlow","``","server",".","To","change","the","type","of","plots","to","be","logged",",","pass","a","list","containing","plot","IDs",".","Refer","to","documentation","of","``","plot_model","``",".","Ignored","when","``","log_experiment","``","is","False",".","log_profile",":","bool",",","default","=","False","When","set","to","True",",","data","profile","is","logged","on","the","``","MLflow","``","server","as","a","html","file",".","Ignored","when","``","log_experiment","``","is","False",".","log_data",":","bool",",","default","=","False","When","set","to","True",",","dataset","is","logged","on","the","``","MLflow","``","server","as","a","csv","file",".","Ignored","when","``","log_experiment","``","is","False",".","verbose",":","bool",",","default","=","True","When","set","to","False",",","Information","grid","is","not","printed",".","memory",":","str",",","bool","or","Memory",",","default=True","Used","to","cache","the","fitted","transformers","of","the","pipeline",".","If","False",":","No","caching","is","performed",".","If","True",":","A","default","temp","directory","is","used",".","If","str",":","Path","to","the","caching","directory",".","profile",":","bool",",","default","=","False","When","set","to","True",",","an","interactive","EDA","report","is","displayed",".","profile_kwargs",":","dict",",","default","=","{","}","(","empty","dict",")","Dictionary","of","arguments","passed","to","the","ProfileReport","method","used","to","create","the","EDA","report",".","Ignored","if","``","profile","``","is","False",".","Returns",":","Global","variables","that","can","be","changed","using","the","``","set_config","``","function","."]
code: def setup(
      self,
      data: Optional[DATAFRAME_LIKE] = None,
      data_func: Optional[
          Callable[[], Union[pd.Series, pd.DataFrame]]
      ] = None,
      index: Union[bool, int, str, SEQUENCE_LIKE] = True,
      ordinal_features: Optional[Dict[str, list]] = None,
      numeric_features: Optional[List[str]] = None,
      categorical_features: Optional[List[str]] = None,
      date_features: Optional[List[str]] = None,
      text_features: Optional[List[str]] = None,
      ignore_features: Optional[List[str]] = None,
      keep_features: Optional[List[str]] = None,
      preprocess: bool = True,
      create_date_columns: List[str] = ["day", "month", "year"],
      imputation_type: Optional[str] = "simple",
      numeric_imputation: str = "mean",
      categorical_imputation: str = "mode",
      text_features_method: str = "tf-idf",
      max_encoding_ohe: int = -1,
      encoding_method: Optional[Any] = None,
      rare_to_value: Optional[float] = None,
      rare_value: str = "rare",
      polynomial_features: bool = False,
      polynomial_degree: int = 2,
      low_variance_threshold: Optional[float] = None,
      group_features: Optional[dict] = None,
      drop_groups: bool = False,
      remove_multicollinearity: bool = False,
      multicollinearity_threshold: float = 0.9,
      bin_numeric_features: Optional[List[str]] = None,
      remove_outliers: bool = False,
      outliers_method: str = "iforest",
      outliers_threshold: float = 0.05,
      transformation: bool = False,
      transformation_method: str = "yeo-johnson",
      normalize: bool = False,
      normalize_method: str = "zscore",
      pca: bool = False,
      pca_method: str = "linear",
      pca_components: Optional[Union[int, float, str]] = None,
      custom_pipeline: Optional[Any] = None,
      custom_pipeline_position: int = -1,
      n_jobs: Optional[int] = -1,
      use_gpu: bool = False,
      html: bool = True,
      session_id: Optional[int] = None,
      system_log: Union[bool, str, logging.Logger] = True,
      log_experiment: Union[
          bool, str, BaseLogger, List[Union[str, BaseLogger]]
      ] = False,
      experiment_name: Optional[str] = None,
      experiment_custom_tags: Optional[Dict[str, Any]] = None,
      log_plots: Union[bool, list] = False,
      log_profile: bool = False,
      log_data: bool = False,
      verbose: bool = True,
      memory: Union[bool, str, Memory] = True,
      profile: bool = False,
      profile_kwargs: Optional[Dict[str, Any]] = None,
      engines: Optional[Dict[str, str]] = None,
  ):
      """
  
      This function initializes the training environment and creates the transformation
      pipeline. Setup function must be called before executing any other function. It
      takes one mandatory parameter: ``data``. All the other parameters are optional.
  
  
      Example
      -------
      >>> from pycaret.datasets import get_data
      >>> jewellery = get_data('jewellery')
      >>> from pycaret.clustering import *
      >>> exp_name = setup(data = jewellery)
  
  
      data: dataframe-like
          Data set with shape (n_samples, n_features), where n_samples is the
          number of samples and n_features is the number of features. If data
          is not a pandas dataframe, it's converted to one using default column
          names.
  
  
      data_func: Callable[[], DATAFRAME_LIKE] = None
          The function that generate ``data`` (the dataframe-like input). This
          is useful when the dataset is large, and you need parallel operations
          such as ``compare_models``. It can avoid broadcasting large dataset
          from driver to workers. Notice one and only one of ``data`` and
          ``data_func`` must be set.
  
      index: bool, int, str or sequence, default = True
          Handle indices in the `data` dataframe.
              - If False: Reset to RangeIndex.
              - If True: Keep the provided index.
              - If int: Position of the column to use as index.
              - If str: Name of the column to use as index.
              - If sequence: Array with shape=(n_samples,) to use as index.
  
  
      ordinal_features: dict, default = None
          Categorical features to be encoded ordinally. For example, a categorical
          feature with 'low', 'medium', 'high' values where low < medium < high can
          be passed as ordinal_features = {'column_name' : ['low', 'medium', 'high']}.
  
  
      numeric_features: list of str, default = None
          If the inferred data types are not correct, the numeric_features param can
          be used to define the data types. It takes a list of strings with column
          names that are numeric.
  
  
      categorical_features: list of str, default = None
          If the inferred data types are not correct, the categorical_features param
          can be used to define the data types. It takes a list of strings with column
          names that are categorical.
  
  
      date_features: list of str, default = None
          If the inferred data types are not correct, the date_features param can be
          used to overwrite the data types. It takes a list of strings with column
          names that are DateTime.
  
  
      text_features: list of str, default = None
          Column names that contain a text corpus. If None, no text features are
          selected.
  
  
      ignore_features: list of str, default = None
          ignore_features param can be used to ignore features during preprocessing
          and model training. It takes a list of strings with column names that are
          to be ignored.
  
  
      keep_features: list of str, default = None
          keep_features param can be used to always keep specific features during
          preprocessing, i.e. these features are never dropped by any kind of
          feature selection. It takes a list of strings with column names that are
          to be kept.
  
  
      preprocess: bool, default = True
          When set to False, no transformations are applied except for train_test_split
          and custom transformations passed in ``custom_pipeline`` param. Data must be
          ready for modeling (no missing values, no dates, categorical data encoding),
          when preprocess is set to False.
  
  
      create_date_columns: list of str, default = ["day", "month", "year"]
          Columns to create from the date features. Note that created features
          with zero variance (e.g. the feature hour in a column that only contains
          dates) are ignored. Allowed values are datetime attributes from
          `pandas.Series.dt`. The datetime format of the feature is inferred
          automatically from the first non NaN value.
  
  
      imputation_type: str or None, default = 'simple'
          The type of imputation to use. Unsupervised learning only supports
          'imputation_type=simple'. If None, no imputation of missing values
          is performed.
  
  
      numeric_imputation: str, default = 'mean'
          Missing values in numeric features are imputed with 'mean' value of the feature
          in the training dataset. The other available option is 'median' or 'zero'.
  
  
      categorical_imputation: str, default = 'constant'
          Missing values in categorical features are imputed with a constant 'not_available'
          value. The other available option is 'mode'.
  
  
      text_features_method: str, default = "tf-idf"
          Method with which to embed the text features in the dataset. Choose
          between "bow" (Bag of Words - CountVectorizer) or "tf-idf" (TfidfVectorizer).
          Be aware that the sparse matrix output of the transformer is converted
          internally to its full array. This can cause memory issues for large
          text embeddings.
  
  
      max_encoding_ohe: int, default = -1
          Categorical columns with `max_encoding_ohe` or less unique values are
          encoded using OneHotEncoding. If more, the `encoding_method` estimator
          is used. Note that columns with exactly two classes are always encoded
          ordinally. Set to below 0 to always use OneHotEncoding.
  
  
      encoding_method: category-encoders estimator, default = None
          A `category-encoders` estimator to encode the categorical columns
          with more than `max_encoding_ohe` unique values. If None,
          `category_encoders.basen.BaseN` is used.
  
  
      rare_to_value: float or None, default=None
          Minimum fraction of category occurrences in a categorical column.
          If a category is less frequent than `rare_to_value * len(X)`, it is
          replaced with the string in `rare_value`. Use this parameter to group
          rare categories before encoding the column. If None, ignores this step.
  
  
      rare_value: str, default="rare"
          Value with which to replace rare categories. Ignored when
          ``rare_to_value`` is None.
  
  
      polynomial_features: bool, default = False
          When set to True, new features are derived using existing numeric features.
  
  
      polynomial_degree: int, default = 2
          Degree of polynomial features. For example, if an input sample is two dimensional
          and of the form [a, b], the polynomial features with degree = 2 are:
          [1, a, b, a^2, ab, b^2]. Ignored when ``polynomial_features`` is not True.
  
  
      low_variance_threshold: float or None, default = None
          Remove features with a training-set variance lower than the provided
          threshold. If 0, keep all features with non-zero variance, i.e. remove
          the features that have the same value in all samples. If None, skip
          this transformation step.
  
  
      group_features: dict or None, default = None
          When the dataset contains features with related characteristics,
          add new fetaures with the following statistical properties of that
          group: min, max, mean, std, median and mode. The parameter takes a
          dict with the group name as key and a list of feature names
          belonging to that group as value.
  
  
      drop_groups: bool, default=False
          Whether to drop the original features in the group. Ignored when
          ``group_features`` is None.
  
  
      remove_multicollinearity: bool, default = False
          When set to True, features with the inter-correlations higher than
          the defined threshold are removed. For each group, it removes all
          except the first feature.
  
  
      multicollinearity_threshold: float, default = 0.9
          Minimum absolute Pearson correlation to identify correlated
          features. The default value removes equal columns. Ignored when
          ``remove_multicollinearity`` is not True.
  
  
      bin_numeric_features: list of str, default = None
          To convert numeric features into categorical, bin_numeric_features parameter can
          be used. It takes a list of strings with column names to be discretized. It does
          so by using 'sturges' rule to determine the number of clusters and then apply
          KMeans algorithm. Original values of the feature are then replaced by the
          cluster label.
  
  
      remove_outliers: bool, default = False
          When set to True, outliers from the training data are removed using an
          Isolation Forest.
  
  
      outliers_method: str, default = "iforest"
          Method with which to remove outliers. Possible values are:
              - 'iforest': Uses sklearn's IsolationForest.
              - 'ee': Uses sklearn's EllipticEnvelope.
              - 'lof': Uses sklearn's LocalOutlierFactor.
  
  
      outliers_threshold: float, default = 0.05
          The percentage outliers to be removed from the dataset. Ignored
          when ``remove_outliers=False``.
  
  
      transformation: bool, default = False
          When set to True, it applies the power transform to make data more Gaussian-like.
          Type of transformation is defined by the ``transformation_method`` parameter.
  
  
      transformation_method: str, default = 'yeo-johnson'
          Defines the method for transformation. By default, the transformation method is
          set to 'yeo-johnson'. The other available option for transformation is 'quantile'.
          Ignored when ``transformation`` is not True.
  
  
      normalize: bool, default = False
          When set to True, it transforms the features by scaling them to a given
          range. Type of scaling is defined by the ``normalize_method`` parameter.
  
  
      normalize_method: str, default = 'zscore'
          Defines the method for scaling. By default, normalize method is set to 'zscore'
          The standard zscore is calculated as z = (x - u) / s. Ignored when ``normalize``
          is not True. The other options are:
  
          - minmax: scales and translates each feature individually such that it is in
          the range of 0 - 1.
          - maxabs: scales and translates each feature individually such that the
          maximal absolute value of each feature will be 1.0. It does not
          shift/center the data, and thus does not destroy any sparsity.
          - robust: scales and translates each feature according to the Interquartile
          range. When the dataset contains outliers, robust scaler often gives
          better results.
  
  
      pca: bool, default = False
          When set to True, dimensionality reduction is applied to project the data into
          a lower dimensional space using the method defined in ``pca_method`` parameter.
  
  
      pca_method: str, default = 'linear'
          Method with which to apply PCA. Possible values are:
              - 'linear': Uses Singular Value  Decomposition.
              - 'kernel': Dimensionality reduction through the use of RBF kernel.
              - 'incremental': Similar to 'linear', but more efficient for large datasets.
  
  
      pca_components: int, float, str or None, default = None
          Number of components to keep. This parameter is ignored when `pca=False`.
              - If None: All components are kept.
              - If int: Absolute number of components.
              - If float: Such an amount that the variance that needs to be explained
                          is greater than the percentage specified by `n_components`.
                          Value should lie between 0 and 1 (ony for pca_method='linear').
              - If "mle": Minka’s MLE is used to guess the dimension (ony for pca_method='linear').
  
  
      custom_pipeline: list of (str, transformer), dict or Pipeline, default = None
          Addidiotnal custom transformers. If passed, they are applied to the
          pipeline last, after all the build-in transformers.
  
  
      custom_pipeline_position: int, default = -1
          Position of the custom pipeline in the overal preprocessing pipeline.
          The default value adds the custom pipeline last.
  
  
      n_jobs: int, default = -1
          The number of jobs to run in parallel (for functions that supports parallel
          processing) -1 means using all processors. To run all functions on single
          processor set n_jobs to None.
  
  
      use_gpu: bool or str, default = False
          When set to True, it will use GPU for training with algorithms that support it,
          and fall back to CPU if they are unavailable. When set to 'force', it will only
          use GPU-enabled algorithms and raise exceptions when they are unavailable. When
          False, all algorithms are trained using CPU only.
  
          GPU enabled algorithms:
  
          - None at this moment.
  
  
      html: bool, default = True
          When set to False, prevents runtime display of monitor. This must be set to False
          when the environment does not support IPython. For example, command line terminal,
          Databricks Notebook, Spyder and other similar IDEs.
  
  
      session_id: int, default = None
          Controls the randomness of experiment. It is equivalent to 'random_state' in
          scikit-learn. When None, a pseudo random number is generated. This can be used
          for later reproducibility of the entire experiment.
  
  
      system_log: bool or str or logging.Logger, default = True
          Whether to save the system logging file (as logs.log). If the input
          is a string, use that as the path to the logging file. If the input
          already is a logger object, use that one instead.
  
  
      log_experiment: bool, default = False
          A (list of) PyCaret ``BaseLogger`` or str (one of 'mlflow', 'wandb', 'comet_ml')
          corresponding to a logger to determine which experiment loggers to use.
          Setting to True will use just MLFlow.
          If ``wandb`` (Weights & Biases) or ``comet_ml``is installed, will also log there.
  
  
      experiment_name: str, default = None
          Name of the experiment for logging. Ignored when ``log_experiment`` is False.
  
  
      experiment_custom_tags: dict, default = None
          Dictionary of tag_name: String -> value: (String, but will be string-ified
          if not) passed to the mlflow.set_tags to add new custom tags for the experiment.
  
  
      log_plots: bool or list, default = False
          When set to True, certain plots are logged automatically in the ``MLFlow`` server.
          To change the type of plots to be logged, pass a list containing plot IDs. Refer
          to documentation of ``plot_model``. Ignored when ``log_experiment`` is False.
  
  
      log_profile: bool, default = False
          When set to True, data profile is logged on the ``MLflow`` server as a html file.
          Ignored when ``log_experiment`` is False.
  
  
      log_data: bool, default = False
          When set to True, dataset is logged on the ``MLflow`` server as a csv file.
          Ignored when ``log_experiment`` is False.
  
  
      verbose: bool, default = True
          When set to False, Information grid is not printed.
  
  
      memory: str, bool or Memory, default=True
          Used to cache the fitted transformers of the pipeline.
              If False: No caching is performed.
              If True: A default temp directory is used.
              If str: Path to the caching directory.
  
  
      profile: bool, default = False
          When set to True, an interactive EDA report is displayed.
  
  
      profile_kwargs: dict, default = {} (empty dict)
          Dictionary of arguments passed to the ProfileReport method used
          to create the EDA report. Ignored if ``profile`` is False.
  
  
      Returns:
          Global variables that can be changed using the ``set_config`` function.
  
      """
  
      self._register_setup_params(dict(locals()))
  
      if (data is None and data_func is None) or (
          data is not None and data_func is not None
      ):
          raise ValueError(
              "One and only one of data and data_func must be set"
          )
  
      # Setup initialization ===================================== >>
  
      runtime_start = time.time()
  
      self.all_allowed_engines = ALL_ALLOWED_ENGINES
  
      self._initialize_setup(
          n_jobs=n_jobs,
          use_gpu=use_gpu,
          html=html,
          session_id=session_id,
          system_log=system_log,
          log_experiment=log_experiment,
          experiment_name=experiment_name,
          memory=memory,
          verbose=verbose,
      )
  
      # Prepare experiment specific params ======================= >>
  
      self.log_plots_param = log_plots
      if self.log_plots_param is True:
          self.log_plots_param = self._get_default_plots_to_log()
      elif isinstance(self.log_plots_param, list):
          for i in self.log_plots_param:
              if i not in self._available_plots:
                  raise ValueError(
                      f"Invalid value for log_plots '{i}'. Possible values "
                      f"are: {', '.join(self._available_plots.keys())}."
                  )
  
      # Set up data ============================================== >>
      if data_func is not None:
          data = data_func()
  
      self.index = index
      self.data = self._set_index(self._prepare_dataset(data))
  
      # Train and Test indices
      self.idx = [self.data.index, None]
  
      self._prepare_column_types(
          ordinal_features=ordinal_features,
          numeric_features=numeric_features,
          categorical_features=categorical_features,
          date_features=date_features,
          text_features=text_features,
          ignore_features=ignore_features,
          keep_features=keep_features,
      )
  
      self._set_exp_model_engines(
          container_default_engines=get_container_default_engines(),
          engine=engines,
      )
  
      # Preprocessing ============================================ >>
  
      # Initialize empty pipeline
      self.pipeline = InternalPipeline(
          steps=[("placeholder", None)],
          memory=self.memory,
      )
  
      if preprocess:
          self.logger.info("Preparing preprocessing pipeline...")
  
          # Convert date feature to numerical values
          if self._fxs["Date"]:
              self._date_feature_engineering(create_date_columns)
  
          # Impute missing values
          if imputation_type == "simple":
              self._simple_imputation(
                  numeric_imputation, categorical_imputation
              )
          elif imputation_type is not None:
              raise ValueError(
                  "Invalid value for the imputation_type parameter, got "
                  f"{imputation_type}. Possible values are: simple."
              )
  
          # Convert text features to meaningful vectors
          if self._fxs["Text"]:
              self._text_embedding(text_features_method)
  
          # Encode non-numerical features
          if self._fxs["Ordinal"] or self._fxs["Categorical"]:
              self._encoding(
                  max_encoding_ohe=max_encoding_ohe,
                  encoding_method=encoding_method,
                  rare_to_value=rare_to_value,
                  rare_value=rare_value,
              )
  
          # Create polynomial features from the existing ones
          if polynomial_features:
              self._polynomial_features(polynomial_degree)
  
          # Drop features with too low variance
          if low_variance_threshold is not None:
              self._low_variance(low_variance_threshold)
  
          # Get statistical properties of a group of features
          if group_features:
              self._group_features(group_features, drop_groups)
  
          # Drop features that are collinear with other features
          if remove_multicollinearity:
              self._remove_multicollinearity(
                  multicollinearity_threshold
              )
  
          # Bin numerical features to 5 clusters
          if bin_numeric_features:
              self._bin_numerical_features(bin_numeric_features)
  
          # Remove outliers from the dataset
          if remove_outliers:
              self._remove_outliers(outliers_method, outliers_threshold)
  
          # Power transform the data to be more Gaussian-like
          if transformation:
              self._transformation(transformation_method)
  
          # Scale the features
          if normalize:
              self._normalization(normalize_method)
  
          # Apply Principal Component Analysis
          if pca:
              self._pca(pca_method, pca_components)
  
      # Add custom transformers to the pipeline
      if custom_pipeline:
          self._add_custom_pipeline(
              custom_pipeline, custom_pipeline_position
          )
  
      # Remove placeholder step
      if ("placeholder", None) in self.pipeline.steps and len(
          self.pipeline
      ) > 1:
          self.pipeline.steps.remove(("placeholder", None))
  
      self.pipeline.fit(self.X)
  
      self.logger.info("Finished creating preprocessing pipeline.")
      self.logger.info(f"Pipeline: {self.pipeline}")
  
      # Final display ============================================ >>
  
      self.logger.info("Creating final display dataframe.")
  
      container = []
      container.append(["Session id", self.seed])
      container.append(["Original data shape", self.data.shape])
      container.append(
          ["Transformed data shape", self.dataset_transformed.shape]
      )
      for fx, cols in self._fxs.items():
          if len(cols) > 0:
              container.append([f"{fx} features", len(cols)])
      if self.data.isna().sum().sum():
          n_nans = (
              100 * self.data.isna().any(axis=1).sum() / len(self.data)
          )
          container.append(
              ["Rows with missing values", f"{round(n_nans, 1)}%"]
          )
      if preprocess:
          container.append(["Preprocess", preprocess])
          container.append(["Imputation type", imputation_type])
          if imputation_type == "simple":
              container.append(
                  ["Numeric imputation", numeric_imputation]
              )
              container.append(
                  ["Categorical imputation", categorical_imputation]
              )
          if self._fxs["Text"]:
              container.append(
                  [
                      "Text features embedding method",
                      text_features_method,
                  ]
              )
          if self._fxs["Categorical"]:
              container.append(
                  ["Maximum one-hot encoding", max_encoding_ohe]
              )
              container.append(["Encoding method", encoding_method])
          if polynomial_features:
              container.append(
                  ["Polynomial features", polynomial_features]
              )
              container.append(["Polynomial degree", polynomial_degree])
          if low_variance_threshold is not None:
              container.append(
                  ["Low variance threshold", low_variance_threshold]
              )
          if remove_multicollinearity:
              container.append(
                  ["Remove multicollinearity", remove_multicollinearity]
              )
              container.append(
                  [
                      "Multicollinearity threshold",
                      multicollinearity_threshold,
                  ]
              )
          if remove_outliers:
              container.append(["Remove outliers", remove_outliers])
              container.append(
                  ["Outliers threshold", outliers_threshold]
              )
          if transformation:
              container.append(["Transformation", transformation])
              container.append(
                  ["Transformation method", transformation_method]
              )
          if normalize:
              container.append(["Normalize", normalize])
              container.append(["Normalize method", normalize_method])
          if pca:
              container.append(["PCA", pca])
              container.append(["PCA method", pca_method])
              container.append(["PCA components", pca_components])
          if custom_pipeline:
              container.append(["Custom pipeline", "Yes"])
          container.append(["CPU Jobs", self.n_jobs_param])
          container.append(["Use GPU", self.gpu_param])
          container.append(["Log Experiment", self.logging_param])
          container.append(["Experiment Name", self.exp_name_log])
          container.append(["USI", self.USI])
  
      self._display_container = [
          pd.DataFrame(container, columns=["Description", "Value"])
      ]
      self.logger.info(
          f"Setup _display_container: {self._display_container[0]}"
      )
      display = CommonDisplay(
          verbose=self.verbose,
          html_param=self.html_param,
      )
      if self.verbose:
          pd.set_option("display.max_rows", 100)
          display.display(
              self._display_container[0].style.apply(highlight_setup)
          )
          pd.reset_option("display.max_rows")  # Reset option
  
      # Wrap-up ================================================== >>
  
      # Create a profile report
      self._profile(profile, profile_kwargs)
  
      # Define models and metrics
      self._all_models, self._all_models_internal = self._get_models()
      self._all_metrics = self._get_metrics()
  
      runtime = np.array(time.time() - runtime_start).round(2)
      self._set_up_logging(
          runtime,
          log_data,
          log_profile,
          experiment_custom_tags=experiment_custom_tags,
      )
  
      self._setup_ran = True
      self.logger.info(
          f"setup() successfully completed in {runtime}s..............."
      )
  
      return self
  
imports: import datetime
  import gc
  import logging
  import time
  import traceback
  from typing import Any, Callable, Dict, List, Optional, Union
  import numpy
  import pandas
  from joblib.memory import Memory
  from sklearn.base import clone
  from pycaret.containers.metrics.clustering import get_all_metric_containers
  from pycaret.containers.models.clustering import ALL_ALLOWED_ENGINES, get_container_default_engines
  from pycaret.internal.display import CommonDisplay
  from pycaret.internal.logging import get_logger, redirect_output
  from pycaret.internal.pipeline import Pipeline
  from pycaret.internal.pipeline import estimator_pipeline, get_pipeline_fit_kwargs
  from pycaret.internal.preprocess.preprocessor import Preprocessor
  from pycaret.internal.pycaret_experiment.tabular_experiment import _TabularExperiment
  from pycaret.internal.validation import is_sklearn_pipeline
  from pycaret.loggers.base_logger import BaseLogger
  from pycaret.utils.constants import DATAFRAME_LIKE, SEQUENCE_LIKE
  from pycaret.utils.generic import MLUsecase, highlight_setup
label_desc: Use image node_id 5 for calling the _UnsupervisedExperiment obj's underlying member method code with example usage: obj.setup(data, data_func, index, ordinal_features, numeric_features, categorical_features, date_features, text_features, ignore_features, keep_features, preprocess, create_date_columns, imputation_type, numeric_imputation, categorical_imputation, text_features_method, max_encoding_ohe, encoding_method, rare_to_value, rare_value, polynomial_features, polynomial_degree, low_variance_threshold, group_features, drop_groups, remove_multicollinearity, multicollinearity_threshold, bin_numeric_features, remove_outliers, outliers_method, outliers_threshold, transformation, transformation_method, normalize, normalize_method, pca, pca_method, pca_components, custom_pipeline, custom_pipeline_position, n_jobs, use_gpu, html, session_id, system_log, log_experiment, experiment_name, experiment_custom_tags, log_plots, log_profile, log_data, verbose, memory, profile, profile_kwargs, engines) and returns: self