class_docstr: Defines and formats data for the Alpha158 dataset.
  
  Attributes:
    column_definition: Defines input and data type of column used in the
      experiment.
    identifiers: Entity identifiers used in experiments.
docstr: Performs feature transformations.
  
  This includes both feature engineering, preprocessing and normalisation.
  
  Args:
    df: Data frame to transform.
  
  Returns:
    Transformed data frame.
code: def transform_inputs(self, df):
      """Performs feature transformations.
  
      This includes both feature engineering, preprocessing and normalisation.
  
      Args:
        df: Data frame to transform.
  
      Returns:
        Transformed data frame.
  
      """
      output = df.copy()
  
      if self._real_scalers is None and self._cat_scalers is None:
          raise ValueError("Scalers have not been set!")
  
      column_definitions = self.get_column_definition()
  
      real_inputs = utils.extract_cols_from_data_type(
          DataTypes.REAL_VALUED,
          column_definitions,
          {InputTypes.ID, InputTypes.TIME},
      )
      categorical_inputs = utils.extract_cols_from_data_type(
          DataTypes.CATEGORICAL,
          column_definitions,
          {InputTypes.ID, InputTypes.TIME},
      )
  
      # Format real inputs
      output[real_inputs] = self._real_scalers.transform(
          df[real_inputs].values
      )
  
      # Format categorical inputs
      for col in categorical_inputs:
          string_df = df[col].apply(str)
          output[col] = self._cat_scalers[col].transform(string_df)
  
      return output
  
file_path: qlib/examples/benchmarks/TFT/data_formatters/qlib_Alpha158.py
imports: import data_formatters.base
  import libs.utils
  import sklearn.preprocessing
label_desc: Use image node_id 4 for calling the Alpha158Formatter obj's underlying member method code with example usage: obj.transform_inputs(df) and returns: output