code: def filter_pseudo_std_regression(
      predictor,
      unlabeled_data: pd.DataFrame,
      num_models,
      leaderboard,
      lower_bound: float = -0.25,
      upper_bound: float = 0.25,
  ):
      """
      Predicts on unlabeled_data using the top num_models. Then gets standard deviation of each
      row's predictions across the top num_models and the standard deviation across all rows of standard
      deviations of the top num_models. Calculates z-score using top num_models predictions standard
      deviation minus the mean of the top num_models standard deviation divided by the standard deviation of
      the top num_model predictions across all rows. The indices of all top num_model predictions who's z-score
      falls within lower_bound and upper_bound will be returned.
  
      Parameters:
      -----------
      predictor: Fitted TabularPredictor
      unlabeled_data: Unlabeled data for top k models to predict on
      leaderboard: pd.DataFrame of leaderboard of models in AutoGluon based on validation score
      num_models: Number of top models to ensemble
      lower_bound: Lower threshold that z-score needs to exceed in order to
          incorporate
      upper_bound: Upper threshold that z-score needs to be below to incorporate
  
      Returns:
      --------
      pd.Series of indices that met pseudo labeling requirements
      """
      top_k_models_list = leaderboard.head(num_models)["model"]
      top_k_preds = None
  
      for model in top_k_models_list:
          y_test_pred = predictor.predict(
              data=unlabeled_data, model=model
          )
  
          if model == top_k_models_list[0]:
              top_k_preds = y_test_pred
          else:
              top_k_preds = pd.concat(
                  [top_k_preds, y_test_pred], axis=1
              )
  
      # Todo: This doesn't make total sense, because weighted ensemble
      # will ensemble the top models and weigh them according to validation score
      # maybe should just force prediction using weighted ensemble instead of
      # uniform across top k?
      top_k_avg_preds = top_k_preds.mean(axis=1)
      top_k_preds = top_k_preds.to_numpy()
      preds_sd = pd.Series(
          data=np.std(top_k_preds, axis=1), index=unlabeled_data.index
      )
      preds_z_score = (preds_sd - preds_sd.mean()) / preds_sd.std()
      df_filtered = preds_z_score.between(lower_bound, upper_bound)
  
      return df_filtered[df_filtered], top_k_avg_preds
  
file_path: autogluon/core/src/autogluon/core/pseudolabeling/pseudolabeling.py
imports: import logging
  import numpy
  import pandas
  from autogluon.core.constants import PROBLEM_TYPES_CLASSIFICATION
label_desc: Use image node_id 4 for calling a global function with example usage: filter_pseudo_std_regression(predictor, unlabeled_data, num_models, leaderboard, lower_bound, upper_bound) and returns: df_filtered,  top_k_avg_preds