code: def regression(
      target,
      predictions,
      sample_weight=None,
      sensitive_features=None,
      fairness_metric=None,
      fairness_threshold=None,
      privileged_groups=[],
      underprivileged_groups=[],
      previous_fairness_optimization=None,
  ):
      regression_metrics = {
          "MAE": mean_absolute_error,
          "MSE": mean_squared_error,
          "RMSE": lambda t, p, sample_weight: np.sqrt(
              mean_squared_error(t, p, sample_weight=sample_weight)
          ),
          "R2": r2_score,
          "MAPE": mean_absolute_percentage_error,
      }
      max_metrics = {}
      for k, v in regression_metrics.items():
          max_metrics[k] = v(
              target, predictions, sample_weight=sample_weight
          )
  
      metrics = {
          "max_metrics": pd.DataFrame(
              {
                  "Metric": list(max_metrics.keys()),
                  "Score": list(max_metrics.values()),
              }
          ),
          "additional_plots": AdditionalPlots.plots_regression(
              target, predictions
          ),
      }
  
      if sensitive_features is not None:
          metrics["fairness_metrics"] = FairnessMetrics.regression(
              target,
              predictions,
              sensitive_features,
              fairness_metric,
              fairness_threshold,
              privileged_groups,
              underprivileged_groups,
              previous_fairness_optimization,
          )
  
      return metrics
  
imports: import copy
  import json
  import logging
  import os
  import time
  import uuid
  import warnings
  import numpy
  import pandas
  from sklearn.metrics import accuracy_score, classification_report, confusion_matrix, f1_score, matthews_corrcoef, mean_absolute_error, mean_absolute_percentage_error, mean_squared_error, precision_score, r2_score, recall_score, roc_auc_score
  from supervised.algorithms.registry import BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, REGRESSION
  from supervised.utils.metric import logloss
  from supervised.utils.config import LOG_LEVEL
  from tabulate import tabulate
  from supervised.fairness.metrics import FairnessMetrics
  from supervised.fairness.report import FairnessReport
  from supervised.fairness.utils import accuracy, false_negative_rate, false_positive_rate, selection_rate, true_negative_rate, true_positive_rate
  from supervised.utils.additional_plots import AdditionalPlots
  from supervised.utils.common import construct_learner_name, get_fold_repeat_cnt
  from supervised.utils.learning_curves import LearningCurves
  from supervised.utils.jsonencoder import MLJSONEncoder
label_desc: Use image node_id 3 for calling the AdditionalMetrics obj's underlying member method code with example usage: obj.regression(target, predictions, sample_weight, sensitive_features, fairness_metric, fairness_threshold, privileged_groups, underprivileged_groups, previous_fairness_optimization) and returns: metrics