docs: def regression_errors(y, y_hat, smoothing_window=0.01, smooth=True):
      """Compute an array of absolute errors comparing predictions and expected output.
  
      If smooth is True, apply EWMA to the resulting array of errors.
  
      Args:
          y (array): Ground truth.
          y_hat (array): Predictions array.
          smoothing_window (float): Size of the smoothing window, expressed as a proportion
              of the total length of y.
          smooth (bool): whether the returned errors should be smoothed with EWMA.
  
      Returns:
          (array): errors
      """
      errors = np.abs(y - y_hat)[:, 0]
  
      if not smooth:
          return errors
  
      smoothing_window = int(smoothing_window * len(y))
  
      return pd.Series(errors).ewm(span=smoothing_window).mean().values