class_docstr: Base class for a deep forecaster model
docstr: Get numpy prediction and loss with evaluation mode for a given dataset or data
  
  :param eval_dataset: Evaluation dataset
  
  :return: The numpy prediction of the model and the average loss for the given dataset.
docstr_tok: ["Get","numpy","prediction","and","loss","with","evaluation","mode","for","a","given","dataset","or","data",":","param","eval_dataset",":","Evaluation","dataset",":","return",":","The","numpy","prediction","of","the","model","and","the","average","loss","for","the","given","dataset","."]
code: def _get_np_loss_and_prediction(
      self, eval_dataset: RollingWindowDataset
  ):
      """
      Get numpy prediction and loss with evaluation mode for a given dataset or data
  
      :param eval_dataset: Evaluation dataset
  
      :return: The numpy prediction of the model and the average loss for the given dataset.
      """
      self.deep_model.eval()
      all_preds = []
      total_loss = []
      for i, batch in enumerate(eval_dataset):
          with torch.no_grad():
              (
                  loss,
                  outputs,
                  y_true,
              ) = self._get_batch_model_loss_and_outputs(
                  self._convert_batch_to_tensors(batch)
              )
              pred = outputs.detach().cpu().numpy()
              all_preds.append(pred)
              total_loss.append(loss.item())
  
      preds = np.concatenate(all_preds, axis=0)
      return preds, np.average(total_loss)
  
imports: import copy
  import logging
  import numpy
  import pandas
  from scipy.stats import norm
  from typing import List, Optional, Tuple, Union
  from merlion.models.deep_base import DeepConfig, DeepModelBase
  from merlion.models.forecast.base import ForecasterBase, ForecasterConfig
  from merlion.models.utils.rolling_window_dataset import RollingWindowDataset
  from merlion.models.utils.time_features import get_time_features
  from merlion.models.utils.early_stopping import EarlyStopping
  from merlion.transform.base import TransformBase, Identity
  from merlion.transform.factory import TransformFactory
  from merlion.utils.misc import initializer, ProgressBar
  from merlion.utils.time_series import to_pd_datetime, to_timestamp, TimeSeries, AggregationPolicy, MissingValuePolicy
label_desc: Use image node_id 2 for calling the DeepForecaster obj's underlying member method code with example usage: obj._get_np_loss_and_prediction(eval_dataset) and returns: preds,  np