code: def test_full(self):
      print("-" * 80)
      logger.info("test_full\n" + "-" * 80 + "\n")
      logger.info("Training model...\n")
      train_scores = self.model.train(self.vals_train)
  
      # Make sure the anomaly scores are actually anomaly scores and not a
      # forecast (can happen if multiple inheritance order is incorrect)
      self.assertIsInstance(
          train_scores,
          TimeSeries,
          msg="Expected output of train() to be a TimeSeries of anomaly "
          "scores, but this seems to be a forecast. Check inheritance "
          "order of this forecasting detector.",
      )
      train_scores = train_scores.univariates[train_scores.names[0]]
      train_vals = self.model.transform(self.vals_train)
      train_vals = train_vals.univariates[train_vals.names[0]]
      self.assertNotAlmostEqual(
          train_scores.values[-1],
          train_vals.values[-1],
          delta=np.log(100),
          msg="Expected output of train() to be a TimeSeries of anomaly "
          "scores, but this seems to be a forecast. Check inheritance "
          "order of this forecasting detector.",
      )
  
      # score function returns the raw anomaly scores
      scores = self.model.get_anomaly_score(self.vals_test).to_pd()
      logger.info(f"Scores look like:\n{scores[:5]}")
      logger.info("max score = " + str(np.max(scores.values.flatten())))
      logger.info(
          "min score = " + str(np.min(scores.values.flatten())) + "\n"
      )
  
      # alarm function returns the post-rule processed anomaly scores
      alarms = self.model.get_anomaly_label(self.vals_test)
      n_alarms = np.sum(alarms.to_pd().values != 0)
      logger.info(f"Alarms look like:\n{alarms[:5]}")
      logger.info(f"Number of alarms: {n_alarms}\n")
      self.assertLessEqual(n_alarms, 15)
  
      logger.info(
          "Verifying that scores don't change much on re-evaluation...\n"
      )
      scoresv2 = (
          self.model.get_anomaly_score(self.vals_test, self.vals_train)
          .to_pd()
          .loc[scores.index]
      )
      self.assertAlmostEqual(
          np.mean(np.abs(scores - scoresv2)).item(), 0, delta=0.05
      )
  
      # We test save/load AFTER our first prediction because we need the old
      # posterior samples for reproducibility
      logger.info(
          "Verifying that scores don't change much after save/load...\n"
      )
      self.model.save(dirname=join(rootdir, "tmp", "prophet"))
      loaded_model = AutoProphet.load(
          dirname=join(rootdir, "tmp", "prophet")
      )
      scoresv3 = loaded_model.get_anomaly_score(self.vals_test).to_pd()
      self.assertAlmostEqual(
          np.mean(np.abs(scores - scoresv3)).item(), 0, delta=0.05
      )
  
file_path: merlion/tests/anomaly/forecast_based/test_prophet.py
imports: import logging
  import math
  from os.path import abspath, dirname, join
  import sys
  import unittest
  import numpy
  import pandas
  from merlion.models.automl.autoprophet import AutoProphet
  from merlion.models.anomaly.forecast_based.prophet import ProphetDetector, ProphetDetectorConfig
  from merlion.utils.data_io import csv_to_time_series
  from merlion.utils.time_series import TimeSeries
  from merlion.transform.normalize import BoxCoxTransform
  from merlion.transform.resample import TemporalResample
label_desc: Use image node_id 2 for calling the TestProphet obj's underlying member method code with example usage: obj.test_full() without return types