predict

TimeSeriesFoundationModel.predict(data: str | Path | DataFrame, target: str = 'target', id_column: str = 'item_id', timestamp_column: str = 'timestamp', known_covariates: str | Path | DataFrame | None = None, static_features: str | Path | DataFrame | None = None, prediction_length: int = 1, quantile_levels: List[float] | None = None, hyperparameters: Dict[str, Any] | None = None, instance_type: str | None = None, framework_version: str = 'latest', custom_image_uri: str | None = None, wait: bool = True, predictions_path: str | None = None, **backend_kwargs) DataFrame | None[source]

Run batch prediction for time series.

Parameters:
  • data – Historical time series to forecast from, in long format, as a DataFrame or local/S3 path to a data file. See the TimeSeriesPredictor docs for the expected format.

  • target – Name of the column that contains the target values to forecast.

  • id_column – Name of the column with the unique identifier of each time series (item).

  • timestamp_column – Name of the column with the observation timestamps.

  • known_covariates – Future values of the known covariates over the forecast horizon. Covariate column names are inferred from the columns (excluding id_column and timestamp_column).

  • static_features – Static (time-independent) features describing each individual time series.

  • prediction_length – Forecast horizon: how many time steps into the future the model should predict.

  • quantile_levels – List of increasing decimals between 0 and 1 specifying which quantiles to estimate. Defaults to [0.1, 0.2, ..., 0.9].

  • hyperparameters – Model hyperparameters for inference. Overrides values passed to the constructor.

  • instance_type – Instance type for the prediction job. If None, uses registry default.

  • framework_version – Container framework version.

  • custom_image_uri – Custom Docker image URI for the container.

  • wait – If True, block and return DataFrame. If False, return the job handle.

  • predictions_path – S3 URL where predictions will be written by the prediction job (e.g. s3://my-bucket/runs/2024-05-01/predictions.csv). The container’s SageMaker execution role must have s3:PutObject permission for this location. Defaults to {cloud_output_path}/{job_name}/predictions.csv. Predictions use AutoGluon’s canonical column names item_id and timestamp, regardless of the id_column / timestamp_column passed in.

  • **backend_kwargs – Additional backend-specific arguments (e.g., job_name, volume_size, autogluon_sagemaker_estimator_kwargs).

Return type:

Optional[pd.DataFrame]