code: def outlierDetection(samples_x, samples_y_aggregation):
      outliers = []
      for samples_idx, _ in enumerate(samples_x):
          # sys.stderr.write("[%s] DEBUG: Evaluating %d of %d samples\n"
          #  \ % (os.path.basename(__file__), samples_idx + 1, len(samples_x)))
          diagnostic_regressor_gp = gp_create_model.create_model(
              samples_x[0:samples_idx] + samples_x[samples_idx + 1 :],
              samples_y_aggregation[0:samples_idx]
              + samples_y_aggregation[samples_idx + 1 :],
          )
          mu, sigma = gp_prediction.predict(
              samples_x[samples_idx], diagnostic_regressor_gp["model"]
          )
          # 2.33 is the z-score for 98% confidence level
          if abs(samples_y_aggregation[samples_idx] - mu) > (
              2.33 * sigma
          ):
              outliers.append(
                  {
                      "samples_idx": samples_idx,
                      "expected_mu": mu,
                      "expected_sigma": sigma,
                      "difference": abs(
                          samples_y_aggregation[samples_idx] - mu
                      )
                      - (2.33 * sigma),
                  }
              )
  
      outliers = outliers if outliers else None
      return outliers
  
file_path: nni/nni/algorithms/hpo/metis_tuner/Regression_GP/OutlierDetection.py
imports: import os
  import sys
  from multiprocessing.dummy import Pool
  from .None import CreateModel
  from .None import Prediction
label_desc: Use image node_id 3 for calling a global function with example usage: outlierDetection(samples_x, samples_y_aggregation) and returns: outliers