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, job_name: str | None = None, instance_type: str = 'ml.m5.2xlarge', instance_count: int = 1, custom_image_uri: str | None = None, wait: bool = True, predictions_path: str | None = None, backend_overrides: dict[str, dict[str, Any]] | None = None) DataFrame | None[source]¶
Predict using SageMaker batch transform. When minimizing latency isn’t a concern, then the batch transform functionality may be easier, more scalable, and more appropriate. If you want to minimize latency, deploy an endpoint with deploy() instead. To learn more: https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform.html
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) – Static (time-independent) features describing each individual time series.
known_covariates (str | pd.DataFrame | 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) – Path to the predictor tarball you want to use to predict. Path can be both a local path or a S3 location. If None, will use the most recent trained predictor trained with fit().
framework_version (str, optional) – AutoGluon version, e.g. “1.6”. Inference uses the official AutoGluon DLC image for this version. Defaults to the version used by fit(). If custom_image_uri is set, this argument will be ignored.
job_name (str, default = None) – Name of the launched training job. If None, CloudPredictor creates one with prefix
ag-cloud-timeseries.instance_count (int, default = 1,) – Number of instances used to do batch transform.
instance_type (str, default = 'ml.m5.2xlarge') – Instance to be used for batch transform.
wait (bool, default = True) – Whether to wait for batch transform to complete. To be noticed, the function won’t return immediately because there are some preparations needed prior transform.
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.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}}
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.