predict¶
- TimeSeriesCloudPredictor.predict(data: str | DataFrame, *, static_features: str | DataFrame | None = None, known_covariates: str | DataFrame | None = None, predictor_path: str | None = None, framework_version: str | None = None, instance_type: str = 'ml.m5.2xlarge', wait: bool = True, predictions_path: str | None = None, backend_overrides: dict[str, dict[str, Any]] | None = None, **kwargs: Unpack[BatchTransformKwargs]) DataFrame | None[source]¶
Forecast with a SageMaker batch transform job.
Suited for large datasets. For low-latency predictions, deploy an endpoint with
deploy()instead.datamust use the sameid_column/timestamp_columnnames that were passed tofit().- Parameters:
data (str | pd.DataFrame) – Historical time series to forecast from, in long format, as a
pd.DataFrameor local/S3 path to a data file.static_features (str | pd.DataFrame | None, default = None) – Static (time-independent) features describing each individual time series.
known_covariates (str | pd.DataFrame | None, default = None) – Future values of the known covariates over the forecast horizon. Must be provided if
known_covariates_nameswas specified at fit time.predictor_path (str | None, default = None) – Local or S3 path of the predictor tarball. If
None, uses the predictor trained byfit().framework_version (str | None, default = None) – AutoGluon version, e.g.
"1.6". Inference uses the official AutoGluon DLC image for this version. Defaults to the version used byfit(). Ignored ifcustom_image_uriis set.instance_type (str, default = "ml.m5.2xlarge") – Instance type of the batch transform job.
wait (bool, default = True) – Whether to block until the job completes and return the forecast. If
False, returnsNoneonce the job is launched; useget_batch_inference_job_status()to poll it.predictions_path (str | None, default = None) – S3 prefix under which the batch transform job writes its results (
<predictions_path>/<input file>.out). Defaults to{cloud_output_path}/batch_transform/<timestamp>/results.
- Returns:
pd.DataFrame | None – Forecast in long format with
item_id,timestamp,mean, and one column per quantile, orNoneifwait=False.- Other Parameters:
backend_overrides (dict[str, dict[str, Any]] | None, default = None) – Raw SageMaker request fields for settings without a dedicated argument.
Keys: request names from the SageMaker API section below.
Values: request fields in PascalCase, as in the SageMaker API and boto3. Deep-merged over the request built by AutoGluon-Cloud; lists and other non-dict values replace the generated ones.
Example:
{"CreateTransformJob": {"BatchStrategy": "SingleRecord", "MaxPayloadInMB": 20}}
job_name (str | None, default = None) – Name of the batch transform job. Defaults to a unique name with prefix
ag-cloud-timeseries.instance_count (int, default = 1) – Number of batch transform instances.
custom_image_uri (str | None, default = None) – Custom inference container image URI. If set,
framework_versionis ignored.
SageMaker API
CreateModel: registers the predictor artifact and inference image as a SageMaker model.
CreateTransformJob: runs batch inference on
instance_countxinstance_type. Results are written topredictions_path.
The model is deleted when the job finishes. With
wait=Falseit is kept; delete it with DeleteModel.