predict

TimeSeriesEndpoint.predict(data: str | DataFrame, known_covariates: str | DataFrame | None = None, static_features: str | 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]

Run real-time prediction on the deployed endpoint.

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

  • known_covariates (str | pd.DataFrame | None, default = None) – Future values of the known covariates over the forecast horizon.

  • static_features (str | pd.DataFrame | None, default = None) – Static (time-independent) features describing each individual time series.

  • prediction_length (Trained predictor endpoints raise an error if) – Forecast horizon: how many time steps into the future the model should predict. Defaults to 1 on foundation model endpoints; trained predictor endpoints use the value set at fit time.

  • target (str | None, default = None) – Name of the column that contains the target values to forecast. Defaults to "target" on foundation model endpoints; trained predictor endpoints use the value set at fit time.

  • id_column (str | None, default = None) – Name of the column with the unique identifier of each time series (item). Defaults to "item_id" on foundation model endpoints; trained predictor endpoints use the column set at fit time.

  • timestamp_column (str | None, default = None) – Name of the column with the observation timestamps. Defaults to "timestamp" on foundation model endpoints; trained predictor endpoints use the column set at fit time.

  • quantile_levels (list[float] | None, default = None) – List of increasing decimals between 0 and 1 specifying which quantiles to estimate. Defaults to [0.1, 0.2, ..., 0.9] on foundation model endpoints; trained predictor endpoints use the value set at fit time.

  • prediction_length

  • target

  • is (or quantile_levels)

  • time. (set to a value different from the one used at fit)

Returns:

pd.DataFrame – Predicted forecasts.

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).