class_docstr: Base class for a forecaster model.
  
  .. note::
  
      If your model depends on an evenly spaced time series, make sure to
  
      1. Call `ForecasterBase.train_pre_process` in `ForecasterBase.train`
      2. Call `ForecasterBase.resample_time_stamps` at the start of
         `ForecasterBase.forecast` to get a set of resampled time stamps, and
         call ``time_series.align(reference=time_stamps)`` to align the forecast
         with the original time stamps.
class_docstr_tok: ["Base","class","for","a","forecaster","model",".","..","note",":",":","If","your","model","depends","on","an","evenly","spaced","time","series",",","make","sure","to","1",".","Call","`","ForecasterBase.train_pre_process","`","in","`","ForecasterBase.train","`","2",".","Call","`","ForecasterBase.resample_time_stamps","`","at","the","start","of","`","ForecasterBase.forecast","`","to","get","a","set","of","resampled","time","stamps",",","and","call","``","time_series.align","(","reference=time_stamps",")","``","to","align","the","forecast","with","the","original","time","stamps","."]
docstr: Plots the forecast for the time series in matplotlib, optionally also
  plotting the uncertainty of the forecast, as well as the past values
  (both true and predicted) of the time series.
  
  :param time_series: the time series over whose timestamps we wish to make a forecast. Exactly one of
      ``time_series`` or ``time_stamps`` should be provided.
  :param time_stamps: Either a ``list`` of timestamps we wish to forecast for, or the number of steps (``int``)
      we wish to forecast for. Exactly one of ``time_series`` or ``time_stamps`` should be provided.
  :param time_series_prev: a time series immediately preceding ``time_series``. If given, we use it to initialize
      the forecaster's state. Otherwise, we assume that ``time_series`` immediately follows the training data.
  :param exog_data: A time series of exogenous variables. Exogenous variables are known a priori, and they are
      independent of the variable being forecasted. ``exog_data`` must include data for all of ``time_stamps``;
      if ``time_series_prev`` is given, it must include data for all of ``time_series_prev.time_stamps`` as well.
      Optional. Only supported for models which inherit from `ForecasterExogBase`.
  :param plot_forecast_uncertainty: whether to plot uncertainty estimates (the inter-quartile range) for forecast
      values. Not supported for all models.
  :param plot_time_series_prev: whether to plot ``time_series_prev`` (and the model's fit for it). Only used if
      ``time_series_prev`` is given.
  :param figsize: figure size in pixels
  :param ax: matplotlib axis to add this plot to
  
  :return: (fig, ax): matplotlib figure & axes the figure was plotted on
docstr_tok: ["Plots","the","forecast","for","the","time","series","in","matplotlib",",","optionally","also","plotting","the","uncertainty","of","the","forecast",",","as","well","as","the","past","values","(","both","true","and","predicted",")","of","the","time","series",".",":","param","time_series",":","the","time","series","over","whose","timestamps","we","wish","to","make","a","forecast",".","Exactly","one","of","``","time_series","``","or","``","time_stamps","``","should","be","provided",".",":","param","time_stamps",":","Either","a","``","list","``","of","timestamps","we","wish","to","forecast","for",",","or","the","number","of","steps","(","``","int","``",")","we","wish","to","forecast","for",".","Exactly","one","of","``","time_series","``","or","``","time_stamps","``","should","be","provided",".",":","param","time_series_prev",":","a","time","series","immediately","preceding","``","time_series","``",".","If","given",",","we","use","it","to","initialize","the","forecaster","'s","state",".","Otherwise",",","we","assume","that","``","time_series","``","immediately","follows","the","training","data",".",":","param","exog_data",":","A","time","series","of","exogenous","variables",".","Exogenous","variables","are","known","a","priori",",","and","they","are","independent","of","the","variable","being","forecasted",".","``","exog_data","``","must","include","data","for","all","of","``","time_stamps","``",";","if","``","time_series_prev","``","is","given",",","it","must","include","data","for","all","of","``","time_series_prev.time_stamps","``","as","well",".","Optional",".","Only","supported","for","models","which","inherit","from","`","ForecasterExogBase","`",".",":","param","plot_forecast_uncertainty",":","whether","to","plot","uncertainty","estimates","(","the","inter-quartile","range",")","for","forecast","values",".","Not","supported","for","all","models",".",":","param","plot_time_series_prev",":","whether","to","plot","``","time_series_prev","``","(","and","the","model","'s","fit","for","it",")",".","Only","used","if","``","time_series_prev","``","is","given",".",":","param","figsize",":","figure","size","in","pixels",":","param","ax",":","matplotlib","axis","to","add","this","plot","to",":","return",":","(","fig",",","ax",")",":","matplotlib","figure","&","axes","the","figure","was","plotted","on"]
code: def plot_forecast(
      self,
      *,
      time_series: TimeSeries = None,
      time_stamps: List[int] = None,
      time_series_prev: TimeSeries = None,
      exog_data: TimeSeries = None,
      plot_forecast_uncertainty=False,
      plot_time_series_prev=False,
      figsize=(1000, 600),
      ax=None,
  ):
      """
      Plots the forecast for the time series in matplotlib, optionally also
      plotting the uncertainty of the forecast, as well as the past values
      (both true and predicted) of the time series.
  
      :param time_series: the time series over whose timestamps we wish to make a forecast. Exactly one of
          ``time_series`` or ``time_stamps`` should be provided.
      :param time_stamps: Either a ``list`` of timestamps we wish to forecast for, or the number of steps (``int``)
          we wish to forecast for. Exactly one of ``time_series`` or ``time_stamps`` should be provided.
      :param time_series_prev: a time series immediately preceding ``time_series``. If given, we use it to initialize
          the forecaster's state. Otherwise, we assume that ``time_series`` immediately follows the training data.
      :param exog_data: A time series of exogenous variables. Exogenous variables are known a priori, and they are
          independent of the variable being forecasted. ``exog_data`` must include data for all of ``time_stamps``;
          if ``time_series_prev`` is given, it must include data for all of ``time_series_prev.time_stamps`` as well.
          Optional. Only supported for models which inherit from `ForecasterExogBase`.
      :param plot_forecast_uncertainty: whether to plot uncertainty estimates (the inter-quartile range) for forecast
          values. Not supported for all models.
      :param plot_time_series_prev: whether to plot ``time_series_prev`` (and the model's fit for it). Only used if
          ``time_series_prev`` is given.
      :param figsize: figure size in pixels
      :param ax: matplotlib axis to add this plot to
  
      :return: (fig, ax): matplotlib figure & axes the figure was plotted on
      """
      fig = self.get_figure(
          time_series=time_series,
          time_stamps=time_stamps,
          time_series_prev=time_series_prev,
          exog_data=exog_data,
          plot_forecast_uncertainty=plot_forecast_uncertainty,
          plot_time_series_prev=plot_time_series_prev,
      )
      title = f"{type(self).__name__}: Forecast of {self.target_name}"
      return fig.plot(
          title=title,
          metric_name=self.target_name,
          figsize=figsize,
          ax=ax,
      )
  
imports: from abc import abstractmethod
  import copy
  import logging
  from typing import List, Optional, Tuple, Union
  import numpy
  import pandas
  from scipy.stats import norm
  from merlion.models.base import Config, ModelBase
  from merlion.plot import Figure
  from merlion.transform.base import TransformBase
  from merlion.transform.factory import TransformFactory
  from merlion.transform.normalize import MeanVarNormalize
  from merlion.utils.time_series import to_pd_datetime, to_timestamp, TimeSeries, AggregationPolicy, MissingValuePolicy
label_desc: Use image node_id 20 for calling the ForecasterBase obj's underlying member method code with example usage: obj.plot_forecast() and returns: fig