class_docstr: Class to build a Prophet Model
      
class_docstr_tok: ["Class","to","build","a","Prophet","Model"]
docstr: Return the predictions
  :param testdata The test dataframe containing the exogenous variables to be used for prediction.
  :type testdata Optional[pd.DataFrame]
  :param forecast_period The number of periods to make a prediction for.
  :type forecast_period Optional[int]
  :param simple If True, this method just returns the predictions.
  If False, it will return the standard error, lower and upper confidence interval (if available)
  :type simple bool
  :param return_train_preds If True, this method just returns the train predictions along with test predictions.
  If False, it will return only test predictions
  :type return_train_preds bool
  :rtype NDFrame
docstr_tok: ["Return","the","predictions",":","param","testdata","The","test","dataframe","containing","the","exogenous","variables","to","be","used","for","prediction",".",":","type","testdata","Optional","[","pd.DataFrame","]",":","param","forecast_period","The","number","of","periods","to","make","a","prediction","for",".",":","type","forecast_period","Optional","[","int","]",":","param","simple","If","True",",","this","method","just","returns","the","predictions",".","If","False",",","it","will","return","the","standard","error",",","lower","and","upper","confidence","interval","(","if","available",")",":","type","simple","bool",":","param","return_train_preds","If","True",",","this","method","just","returns","the","train","predictions","along","with","test","predictions",".","If","False",",","it","will","return","only","test","predictions",":","type","return_train_preds","bool",":","rtype","NDFrame"]
code: def predict(
      self,
      testdata: Optional[pd.DataFrame] = None,
      forecast_period: Optional[int] = None,
      simple: bool = False,
      return_train_preds: bool = False,
  ) -> Optional[NDFrame]:
      """
      Return the predictions
      :param testdata The test dataframe containing the exogenous variables to be used for prediction.
      :type testdata Optional[pd.DataFrame]
      :param forecast_period The number of periods to make a prediction for.
      :type forecast_period Optional[int]
      :param simple If True, this method just returns the predictions.
      If False, it will return the standard error, lower and upper confidence interval (if available)
      :type simple bool
      :param return_train_preds If True, this method just returns the train predictions along with test predictions.
      If False, it will return only test predictions
      :type return_train_preds bool
      :rtype NDFrame
      """
  
      """
          Return the predictions
          # TODO: What about future exogenous variables?
          # https://towardsdatascience.com/forecast-model-tuning-with-additional-regressors-in-prophet-ffcbf1777dda
          """
  
      # if testdata is not None:
      #     warnings.warn(
      #         "Multivariate models are not supported by the AutoML prophet module." +
      #         "Univariate predictions will be returned for now."
      #     )
  
      # Prophet is a Little Complicated - You need 2 steps to Forecast
      ## 1. You need to create a dataframe to hold the predictions which specifies datetime
      ##    periods that you want to predict. It automatically creates one with both past
      ##    and future dates.
      ## 2. You need to ask Prophet to make predictions for the past and future dates in
      ##    that dataframe above.
      ## So if you had 2905 rows of data, and ask Prophet to predict for 365 periods,
      ##    it will give you predictions of the past (2905) and an additional 365 rows
      ##    of future (total: 3270) rows of data.
      ### This is where we take the first steps to make a forecast using Prophet:
      ##   1. Create a dataframe with datetime index of past and future dates
  
      # Next we ask Prophet to make predictions for those dates in the dataframe along with prediction intervals
      if self.time_interval in self.list_of_valid_time_ints:
          time_int = copy.deepcopy(self.time_interval)
      else:
          time_int = self.get_prophet_time_interval(for_cv=False)
  
      if self.univariate:
          if isinstance(testdata, int):
              forecast_period = testdata
          elif isinstance(testdata, pd.DataFrame):
              forecast_period = testdata.shape[0]
              if testdata.shape[0] != self.forecast_period:
                  self.forecast_period = testdata.shape[0]
          else:
              forecast_period = self.forecast_period
          self.forecast_period = forecast_period
          future = self.model.make_future_dataframe(
              periods=self.forecast_period, freq=time_int
          )
      else:
          if isinstance(testdata, int) or testdata is None:
              print(
                  "(Error): Model is Multivariate, hence test dataframe must be provided for prediction."
              )
              return None
          elif isinstance(testdata, pd.DataFrame):
              forecast_period = testdata.shape[0]
              if testdata.shape[0] != self.forecast_period:
                  self.forecast_period = testdata.shape[0]
              future = self.prep_col_names_for_prophet(
                  ts_df=testdata, test=True
              )
      print(
          "Building Forecast dataframe. Forecast Period = %d"
          % self.forecast_period
      )
      ### This will work in both univariate and multi-variate cases now ######
  
      forecast = self.model.predict(future)
  
      # Return values for the forecast period only
      if simple:
          if return_train_preds:
              forecast = forecast["yhat"]
          else:
              if forecast_period is None:
                  forecast = forecast["yhat"]
              else:
                  forecast = forecast.iloc[-forecast_period:]["yhat"]
  
      else:
          if return_train_preds:
              forecast = forecast
          else:
              if forecast_period is None:
                  forecast = forecast["yhat"]
              else:
                  forecast = forecast.iloc[-forecast_period:]
  
      return forecast
  
imports: from typing import Optional
  import logging
  import copy
  import time
  import numpy
  from sklearn.model_selection import TimeSeriesSplit
  import pandas
  from pandas.core.generic import NDFrame
  import pdb
  import dask
  import dask.dataframe
  import matplotlib.pyplot
  from prophet import Prophet
  from prophet.diagnostics import cross_validation
  from prophet.diagnostics import performance_metrics
  from prophet.plot import plot_cross_validation_metric
  from .build_base import BuildBase
  from ..utils import print_dynamic_rmse, quick_ts_plot, print_ts_model_stats
  from ..utils.logging import SuppressStdoutStderr
  from sklearn.metrics import mean_squared_error
  from prophet import Prophet
  import time
  import pdb
  import copy
  import matplotlib.pyplot
label_desc: Use image node_id 4 for calling the BuildProphet obj's underlying member method code with example usage: obj.predict(testdata, forecast_period, simple, return_train_preds) and returns: forecast, None