code: def predict_error(y_target, y_pred, case):
      """
      The predict_error function computes the prediction errors from the
      prediction values and the target values.
  
      Parameters
      ----------
      y_target : pandas.DataFrame
          1-column dataframe containing the targets.
      y_pred : pandas.DataFrame
          1-column dataframe containing the predictions.
      case : str
          model case
  
      Returns
      -------
      pandas.DataFrame
          1-column dataframe containing the prediction errors.
      """
      prediction_error = None
      if (
          y_target is not None
          and y_pred is not None
          and case == "regression"
      ):
          if (y_target == 0).any()[0]:
              prediction_error = abs(y_target.values - y_pred.values)
          else:
              prediction_error = abs(
                  (y_target.values - y_pred.values) / y_target.values
              )
          prediction_error = pd.DataFrame(
              prediction_error,
              index=y_target.index,
              columns=["_error_"],
          )
      return prediction_error
  
imports: from inspect import ismethod
  import pandas
label_desc: Use image node_id 4 for calling a global function with example usage: predict_error(y_target, y_pred, case) and returns: prediction_error