code: def median_absolute_error(y_true, y_pred):
      """Median absolute error regression loss
  
      Read more in the :ref:`User Guide <median_absolute_error>`.
  
      Parameters
      ----------
      y_true : array-like of shape = (n_samples)
          Ground truth (correct) target values.
  
      y_pred : array-like of shape = (n_samples)
          Estimated target values.
  
      Returns
      -------
      loss : float
          A positive floating point value (the best value is 0.0).
  
      Examples
      --------
      >>> from sklearn.metrics import median_absolute_error
      >>> y_true = [3, -0.5, 2, 7]
      >>> y_pred = [2.5, 0.0, 2, 8]
      >>> median_absolute_error(y_true, y_pred)
      0.5
  
      """
      y_type, y_true, y_pred, _ = _check_reg_targets(
          y_true, y_pred, "uniform_average"
      )
      if y_type == "continuous-multioutput":
          raise ValueError(
              "Multioutput not supported in median_absolute_error"
          )
      return np.median(np.abs(y_pred - y_true))
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/metrics/regression.py
imports: from __future__ import division
  import numpy
  from ..utils.validation import check_array, check_consistent_length
  from ..utils.validation import column_or_1d
  from ..externals.six import string_types
  import warnings
label_desc: Use image node_id 4 for calling a global function with example usage: median_absolute_error(y_true, y_pred) and returns: np