class_docstr: Abstract base class for all data formatters.
  
  User can implement the abstract methods below to perform dataset-specific
  manipulations.
class_docstr_tok: ["Abstract","base","class","for","all","data","formatters",".","User","can","implement","the","abstract","methods","below","to","perform","dataset-specific","manipulations","."]
docstr: Returns the relevant indexes and input sizes required by TFT.
docstr_tok: ["Returns","the","relevant","indexes","and","input","sizes","required","by","TFT","."]
code: def _get_tft_input_indices(self):
      """Returns the relevant indexes and input sizes required by TFT."""
  
      # Functions
      def _extract_tuples_from_data_type(data_type, defn):
          return [
              tup
              for tup in defn
              if tup[1] == data_type
              and tup[2] not in {InputTypes.ID, InputTypes.TIME}
          ]
  
      def _get_locations(input_types, defn):
          return [
              i for i, tup in enumerate(defn) if tup[2] in input_types
          ]
  
      # Start extraction
      column_definition = [
          tup
          for tup in self.get_column_definition()
          if tup[2] not in {InputTypes.ID, InputTypes.TIME}
      ]
  
      categorical_inputs = _extract_tuples_from_data_type(
          DataTypes.CATEGORICAL, column_definition
      )
      real_inputs = _extract_tuples_from_data_type(
          DataTypes.REAL_VALUED, column_definition
      )
  
      locations = {
          "input_size": len(self._get_input_columns()),
          "output_size": len(
              _get_locations({InputTypes.TARGET}, column_definition)
          ),
          "category_counts": self.num_classes_per_cat_input,
          "input_obs_loc": _get_locations(
              {InputTypes.TARGET}, column_definition
          ),
          "static_input_loc": _get_locations(
              {InputTypes.STATIC_INPUT}, column_definition
          ),
          "known_regular_inputs": _get_locations(
              {InputTypes.STATIC_INPUT, InputTypes.KNOWN_INPUT},
              real_inputs,
          ),
          "known_categorical_inputs": _get_locations(
              {InputTypes.STATIC_INPUT, InputTypes.KNOWN_INPUT},
              categorical_inputs,
          ),
      }
  
      return locations
  
file_path: qlib/examples/benchmarks/TFT/data_formatters/base.py
imports: import abc
  import enum
label_desc: Use image node_id 11 for calling the GenericDataFormatter obj's underlying member method code with example usage: obj._get_tft_input_indices() and returns: locations, unknown, unknown