code: def print_ts_model_stats(
      actuals: np.array, predicted: np.array, title="Model"
  ):
      """
      This program prints and returns MAE, RMSE, MAPE.
      If you like the MAE and RMSE as a percentage of something, just give that number
      in the input as "number_as_percentage" and it will return the MAE and RMSE as a
      ratio of that number. Returns MAE, MAE_as_percentage, and RMSE_as_percentage
      """
      try:
          number_as_percentage = actuals.std()
          if (predicted.index == actuals.index).all():
              dfplot = pd.DataFrame(actuals).join(
                  pd.DataFrame(predicted)
              )
          else:
              dfplot = pd.DataFrame(
                  [actuals.values, predicted.values]
              ).T
              dfplot.columns = ["Actual", "Forecast"]
          dfplot = dfplot.sort_index()
          plt.figure(figsize=(15, 8))
          plt.plot(dfplot)
          plt.legend(["original", "predicted"])
          plt.title(
              "%s: Actual vs Forecast in expanding (training) Window Cross Validation"
              % title,
              fontsize=20,
          )
      except:
          pass
      print("\n-------------------------------------------")
      print("Model Cross Validation Results:")
      print("-------------------------------------------")
      mae = mean_absolute_error(actuals, predicted)
      mse = mean_squared_error(actuals, predicted)
      print("    MAE (Mean Absolute Error = %0.2f" % mae)
      rmse = np.sqrt(mean_squared_error(actuals, predicted))
      print("    MSE (Mean Squared Error = %0.2f" % mse)
      mape = print_mape(actuals, predicted)
      print("    MAPE (Mean Absolute Percent Error) = %0.0f%%" % (mape))
      print("    RMSE (Root Mean Squared Error) = %0.04f" % (rmse))
      # Normalized RMSE print('RMSE = {:,.Of}'.format(rmse))
      print(
          "    Normalized RMSE (MinMax) = %0.0f%%"
          % (100 * rmse / abs(actuals.max() - actuals.min()))
      )
      rmse_asp = (
          np.sqrt(mean_squared_error(actuals, predicted))
          / number_as_percentage
      ) * 100
      print(
          "    Normalized RMSE (as Std Dev of Actuals)= %0.0f%%"
          % rmse_asp
      )
      return rmse, rmse_asp
  
file_path: Auto_TS/auto_ts/utils/metrics.py
imports: from typing import Tuple
  import numpy
  import pandas
  import matplotlib.pyplot
  from sklearn.metrics import mean_absolute_error, mean_squared_error
  import pdb
label_desc: Use image node_id 6 for calling a global function with example usage: print_ts_model_stats(actuals, predicted, title) and returns: rmse,  rmse_asp