class_docstr: A job provides data available for a single training job.
  
  It is first obtained from a training job run on AWS Sagemaker. By storing
  it locally, it can be loaded from the file system at a later point and no
  Sagemaker connection is required. The initializer of this class should not
  be used directly.
class_docstr_tok: ["A","job","provides","data","available","for","a","single","training","job",".","It","is","first","obtained","from","a","training","job","run","on","AWS","Sagemaker",".","By","storing","it","locally",",","it","can","be","loaded","from","the","file","system","at","a","later","point","and","no","Sagemaker","connection","is","required",".","The","initializer","of","this","class","should","not","be","used","directly","."]
docstr: Loads the forecasts on the test set for the model with the specified
  index.
  
  Args:
      index: The index of the model among all models trained.
  
  Returns:
      The quantile forecasts on the test set.
docstr_tok: ["Loads","the","forecasts","on","the","test","set","for","the","model","with","the","specified","index",".","Args",":","index",":","The","index","of","the","model","among","all","models","trained",".","Returns",":","The","quantile","forecasts","on","the","test","set","."]
code: def get_forecast(self, index: int) -> QuantileForecasts:
      """
      Loads the forecasts on the test set for the model with the specified
      index.
  
      Args:
          index: The index of the model among all models trained.
  
      Returns:
          The quantile forecasts on the test set.
      """
      # If this job was initialized from Sagemaker, load it from the Sagemaker job
      if self.source_job is not None:
          with self.source_job.artifact(cache=False) as artifact:
              return QuantileForecasts.load(
                  artifact.path / "predictions" / f"model_{index}"
              )
  
      # Otherwise, load it from the file system
      return QuantileForecasts.load(
          cast(Path, self.source_path)
          / "forecasts"
          / f"model_{index:02}"
      )
  
imports: from __future__ import annotations
  import json
  import math
  import os
  import shutil
  from pathlib import Path
  from typing import Any, cast, Dict, List, Optional, Union
  import numpy
  from tsbench.config import MODEL_REGISTRY
  from tsbench.evaluations.aws import Analysis, TrainingJob
  from tsbench.evaluations.metrics import Metric, Performance
  from tsbench.forecasts import QuantileForecasts
label_desc: Use image node_id 8 for calling the Job obj's underlying member method code with example usage: obj.get_forecast(index) and returns: QuantileForecasts, QuantileForecasts