class_docstr: Base class for an anomaly detection model.
class_docstr_tok: ["Base","class","for","an","anomaly","detection","model","."]
docstr: Returns the model's predicted sequence of anomaly scores.
  
  :param time_series: the `TimeSeries` we wish to predict anomaly scores
      for.
  :param time_series_prev: a `TimeSeries` immediately preceding
      ``time_series``. If given, we use it to initialize the time series
      anomaly detection model. Otherwise, we assume that ``time_series``
      immediately follows the training data.
  :return: a univariate `TimeSeries` of anomaly scores
docstr_tok: ["Returns","the","model","'s","predicted","sequence","of","anomaly","scores",".",":","param","time_series",":","the","`","TimeSeries","`","we","wish","to","predict","anomaly","scores","for",".",":","param","time_series_prev",":","a","`","TimeSeries","`","immediately","preceding","``","time_series","``",".","If","given",",","we","use","it","to","initialize","the","time","series","anomaly","detection","model",".","Otherwise",",","we","assume","that","``","time_series","``","immediately","follows","the","training","data",".",":","return",":","a","univariate","`","TimeSeries","`","of","anomaly","scores"]
code: def get_anomaly_score(
      self, time_series: TimeSeries, time_series_prev: TimeSeries = None
  ) -> TimeSeries:
      """
      Returns the model's predicted sequence of anomaly scores.
  
      :param time_series: the `TimeSeries` we wish to predict anomaly scores
          for.
      :param time_series_prev: a `TimeSeries` immediately preceding
          ``time_series``. If given, we use it to initialize the time series
          anomaly detection model. Otherwise, we assume that ``time_series``
          immediately follows the training data.
      :return: a univariate `TimeSeries` of anomaly scores
      """
      # Ensure the dimensions are correct
      assert (
          time_series.dim == self.dim
      ), f"Expected time_series to have dimension {self.dim}, but got {time_series.dim}."
      if time_series_prev is not None:
          assert (
              time_series_prev.dim == self.dim
          ), f"Expected time_series_prev to have dimension {self.dim}, but got {time_series_prev.dim}."
  
      # Transform the time series
      time_series, time_series_prev = self.transform_time_series(
          time_series, time_series_prev
      )
      if self.require_univariate:
          assert time_series.dim == 1, (
              f"{type(self).__name__} model only accepts univariate time series, but time series "
              f"(after transform {self.transform}) has dimension {time_series.dim}."
          )
  
      time_series = time_series.to_pd()
      if time_series_prev is not None:
          time_series_prev = time_series_prev.to_pd()
  
      # Get the anomaly scores & ensure the dimensions are correct
      anom_scores = self._get_anomaly_score(
          time_series, time_series_prev
      )
      assert (
          anom_scores.shape[1] == 1
      ), f"Expected anomaly scores returned by {type(self)} to be univariate."
      return UnivariateTimeSeries.from_pd(
          anom_scores, name="anom_score"
      ).to_ts()
  
imports: from abc import abstractmethod
  import copy
  import inspect
  import logging
  from typing import Any, Dict, List, Union
  import pandas
  from scipy.stats import norm
  from merlion.models.base import Config, ModelBase, MultipleTimeseriesModelMixin
  from merlion.plot import Figure, MTSFigure
  from merlion.post_process.calibrate import AnomScoreCalibrator
  from merlion.post_process.factory import PostRuleFactory
  from merlion.post_process.sequence import PostRuleSequence
  from merlion.post_process.threshold import AggregateAlarms, Threshold
  from merlion.utils import TimeSeries, UnivariateTimeSeries
  from merlion.utils.misc import call_with_accepted_kwargs
label_desc: Use image node_id 11 for calling the DetectorBase obj's underlying member method code with example usage: obj.get_anomaly_score(time_series, time_series_prev) and returns: UnivariateTimeSeries