code: def predict_proba(self, data):
      # For now, we are assuming that data is a list of dictionaries, so if we have a single dict, put it in a list
      if isinstance(data, dict):
          data = [data]
  
      if isinstance(data, pd.DataFrame):
          data = data.to_dict("records")
  
      predictions = []
      for row in data:
          category = row[self.categorical_column]
          if str(category) == "nan":
              category = "nan"
  
          try:
              model = self.trained_models[category]
          except KeyError as e:
              if self.default_category == "_RAISE_ERROR":
                  raise (e)
              model = self.trained_models[self.default_category]
  
          transformed_row = self.transformation_pipeline.transform(row)
          prediction = model.predict_proba(transformed_row)
          predictions.append(prediction)
  
      if len(predictions) == 1:
          return predictions[0]
      else:
          return predictions
  
file_path: auto_ml/auto_ml/utils_categorical_ensembling.py
imports: import pandas
label_desc: Use image node_id 4 for calling the CategoricalEnsembler obj's underlying member method code with example usage: obj.predict_proba(data) and returns: predictions, predictions