code: def _get_regressor_metrics(
      fitted_estimator, prefix, X, y_true, sample_weight
  ):
      """
      Compute and record various common metrics for regressors
  
      For (1) (root) mean squared error:
      https://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_squared_error.html
      (2) mean absolute error:
      https://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_absolute_error.html
      (3) r2 score:
      https://scikit-learn.org/stable/modules/generated/sklearn.metrics.r2_score.html
      By default, we choose the parameter `multioutput` to be `uniform_average`
      to average outputs with uniform weight.
  
      Steps:
      1. Extract X and y_true from fit_args and fit_kwargs, and compute y_pred.
      2. If the sample_weight argument exists in fit_func (accuracy_score by default
      has sample_weight), extract it from fit_args or fit_kwargs as
      (y_true, y_pred, sample_weight, multioutput), otherwise as (y_true, y_pred, multioutput)
      3. return a dictionary of metric(name, value)
  
      :param fitted_estimator: The already fitted regressor
      :param fit_args: Positional arguments given to fit_func.
      :param fit_kwargs: Keyword arguments given to fit_func.
      :return: dictionary of (function name, computed value)
      """
      import sklearn
  
      y_pred = fitted_estimator.predict(X)
  
      regressor_metrics = [
          _SklearnMetric(
              name=prefix + "mean_squared_error",
              function=sklearn.metrics.mean_squared_error,
              arguments={
                  "y_true": y_true,
                  "y_pred": y_pred,
                  "sample_weight": sample_weight,
                  "multioutput": "uniform_average",
              },
          ),
          _SklearnMetric(
              name=prefix + "mean_absolute_error",
              function=sklearn.metrics.mean_absolute_error,
              arguments={
                  "y_true": y_true,
                  "y_pred": y_pred,
                  "sample_weight": sample_weight,
                  "multioutput": "uniform_average",
              },
          ),
          _SklearnMetric(
              name=prefix + "r2_score",
              function=sklearn.metrics.r2_score,
              arguments={
                  "y_true": y_true,
                  "y_pred": y_pred,
                  "sample_weight": sample_weight,
                  "multioutput": "uniform_average",
              },
          ),
      ]
  
      # To be compatible with older versions of scikit-learn (below 0.22.2), where
      # `sklearn.metrics.mean_squared_error` does not have "squared" parameter to calculate `rmse`,
      # we compute it through np.sqrt(<value of mse>)
      metrics_value_dict = _get_metrics_value_dict(regressor_metrics)
      metrics_value_dict[prefix + "root_mean_squared_error"] = np.sqrt(
          metrics_value_dict[prefix + "mean_squared_error"]
      )
  
      return metrics_value_dict
  
imports: import collections
  import inspect
  import logging
  import pkgutil
  import platform
  import warnings
  from copy import deepcopy
  from importlib import import_module
  from numbers import Number
  from operator import itemgetter
  import numpy
  from packaging.version import Version
  from mlflow import MlflowClient
  from mlflow.utils.arguments_utils import _get_arg_names
  from mlflow.utils.file_utils import TempDir
  from mlflow.utils.mlflow_tags import MLFLOW_PARENT_RUN_ID
  from mlflow.utils.time import get_current_time_millis
label_desc: Use image node_id 9 for calling a global function with example usage: _get_regressor_metrics(fitted_estimator, prefix, X, y_true, sample_weight) and returns: metrics_value_dict