code: def test_full(self):
      # score function returns the raw anomaly scores
      print("-" * 80)
      logger.info("test_full\n" + "-" * 80 + "\n")
      logger.info("Training model...\n")
      self.model.train(self.train_data, self.train_labels)
  
      # Scores
      print()
      scores = self.model.get_anomaly_score(self.test_data)
      logger.info(f"\nScores look like:\n{scores[:5]}")
      scores = scores.to_pd().values.flatten()
      logger.info("max score = " + str(max(scores)))
      logger.info("min score = " + str(min(scores)) + "\n")
  
      # Alarms
      alarms = self.model.get_anomaly_label(self.test_data)
      logger.info(f"Alarms look like:\n{alarms[:5]}")
      n_alarms = np.sum(alarms.to_pd().values != 0)
      logger.info(f"Number of alarms: {n_alarms}\n")
      self.assertLessEqual(n_alarms, 15)
  
      # Serialization/deserialization
      self.model.save(dirname=join(rootdir, "tmp", "dpad"))
      loaded_model = DeepPointAnomalyDetector.load(
          dirname=join(rootdir, "tmp", "dpad")
      )
      loaded_alarms = loaded_model.get_anomaly_label(self.test_data)
      n_loaded_alarms = sum(loaded_alarms.to_pd().values != 0)
      self.assertAlmostEqual(n_loaded_alarms, n_alarms, delta=1)
  
      # Evaluation
      f1 = TSADMetric.F1.value(
          predict=alarms, ground_truth=self.test_labels
      )
      p = TSADMetric.Precision.value(
          predict=alarms, ground_truth=self.test_labels
      )
      r = TSADMetric.Recall.value(
          predict=alarms, ground_truth=self.test_labels
      )
      logger.info(f"F1={f1:.4f}, Precision={p:.4f}, Recall={r:.4f}")
  
file_path: merlion/tests/anomaly/test_dpad.py
imports: import logging
  from os.path import abspath, dirname, join
  import sys
  import unittest
  import numpy
  import pandas
  import torch
  from merlion.evaluate.anomaly import TSADMetric
  from merlion.models.anomaly.deep_point_anomaly_detector import DeepPointAnomalyDetector, DeepPointAnomalyDetectorConfig
  from merlion.transform.moving_average import DifferenceTransform
  from merlion.transform.resample import Shingle, TemporalResample
  from merlion.transform.sequence import TransformSequence
  from merlion.utils import TimeSeries
label_desc: Use image node_id 2 for calling the TestDPAD obj's underlying member method code with example usage: obj.test_full() without return types