predict¶
- TimeSeriesEndpoint.predict(data: str | Path | DataFrame, *, known_covariates: str | Path | DataFrame | None = None, static_features: str | Path | DataFrame | None = None, prediction_length: int | None = None, target: str | None = None, id_column: str | None = None, timestamp_column: str | None = None, quantile_levels: list[float] | None = None) DataFrame[source]¶
Forecast the future values of
datawith the deployed endpoint.On trained predictor endpoints,
prediction_length,target,id_column,timestamp_column, andquantile_levelsdefault to the values set at fit time, and settingprediction_length,target, orquantile_levelsto a different value raises an error.- Parameters:
data (str | pathlib.Path | pd.DataFrame) – Historical time series to forecast from, in long format, as a
pd.DataFrameor local/S3 path to a data file. See the TimeSeriesPredictor docs for the expected format.known_covariates (str | pathlib.Path | pd.DataFrame | None, default = None) – Future values of the known covariates over the forecast horizon, as a
pd.DataFrameor local/S3 path to a data file.static_features (str | pathlib.Path | pd.DataFrame | None, default = None) – Static (time-independent) features describing each individual time series, as a
pd.DataFrameor local/S3 path to a data file.prediction_length (int | None, default = None) – Number of time steps to forecast. Defaults to 1 on foundation model endpoints.
target (str | None, default = None) – Name of the column with the values to forecast. Defaults to
"target"on foundation model endpoints.id_column (str | None, default = None) – Name of the column with the ID of each time series. Defaults to
"item_id"on foundation model endpoints.timestamp_column (str | None, default = None) – Name of the column with the observation timestamps. Defaults to
"timestamp"on foundation model endpoints.quantile_levels (list[float] | None, default = None) – Quantiles to forecast, as floats between 0 and 1. Defaults to
[0.1, 0.2, ..., 0.9]on foundation model endpoints.
- Returns:
pd.DataFrame – Forecasts with
item_idandtimestampcolumns, ameancolumn, and one column per quantile level.
SageMaker API
InvokeEndpoint: sends the data to the endpoint and returns the predictions. The payload is limited to 6 MB (4 MB for serverless endpoints).