Skip to content

Click in-app to access the full platform documentation for your version of DataRobot.

Time series predictions for deployments

Endpoint: /deployments/<deploymentId>/predictions

Makes time series predictions for a deployed model.

Request Method: POST

Request URL: deployed URL, for example: https://your-company.orm.datarobot.com/predApi/v1.0

Request parameters

Headers

Key Description Example(s)
Datarobot-key Required for Managed AI Cloud users; string type DR-key-12345abcdb-xyz6789
Authorization Required; string

Three methods are supported:
  • Bearer authentication
  • (deprecated) Basic authentication: User_email and API token
  • (deprecated) API token
  • Example for Bearer authentication method: Bearer API_key-12345abcdb-xyz6789
  • (deprecated) Example for User_email and API token method: Basic Auth_basic-12345abcdb-xyz6789
  • (deprecated) Example for API token method: Token API_key-12345abcdb-xyz6789

Datarobot-key: This header is required only with Managed AI Cloud. It is used as a precaution to secure user data from other verified DataRobot users. The key can also be retrieved with the following request to the DataRobot API:
GET <URL>/api/v2/modelDeployments/<deploymentId>

Additional time series specific parameters

Key Description Example(s)
forecastPoint Optional; RFC 3339 Datetime string type

An ISO 8601 formatted DateTime string corresponding to the forecast point for the prediction request, either user-configured or selected by DataRobot.
forecastPoint=2013-12-20T00:00:00Z
predictionsStartDate Optional; RFC 3339 Datetime string type

An ISO 8601 formatted DateTime string corresponding to the prediction start date for historical predictions. Must be sent along with predictionsEndDate. Mutually exclusive with forecastPoint.
predictionsStartDate=2013-12-20T00:00:00Z
predictionsEndDate Optional; RFC 3339 Datetime string type

An ISO 8601 formatted DateTime string corresponding to the prediction start date for historical predictions. Must be sent along with predictionsStartDate. Mutually exclusive with forecastPoint.
predictionsEndDate=2013-12-20T00:00:00Z
relaxKnownInAdvanceFeaturesCheck Optional; Boolean type

If True, missing values in the "known in advance" features are allowed in the forecast window at the prediction time. If omitted or False, missing values are not allowed.
relaxKnownInAdvanceFeaturesCheck=true

It is possible to use standard URI parameters, including passthroughColumns, passthroughColumnsSet, and maxExplanations.

XEMP-based explanations support

Time series supports XEMP explanations. See Prediction Explanations for examples of the maxExplanations URI parameter.

Body

Data Type Example(s)
Historic and prediction data JSON Raw data shown in image below.

Response 200

Binary prediction example

{
    "data": [
        {
            "seriesId": null,
            "forecastPoint": "2013-12-20T00:00:00Z",
            "rowId": 35,
            "timestamp": "2013-12-21T00:00:00.000000Z",
            "predictionValues": [
                {
                    "value": 2.3353628422,
                    "label": "sales (actual)"
                }
            ],
            "forecastDistance": 1,
            "prediction": 2.3353628422
        }
    ]
}

Errors List

HTTP Code Sample error message Reason(s)
400 BAD REQUEST {"message": "Based on the forecast point (10/26/08), there are no rows to predict that fall inside of the forecast window (10/27/08 to 11/02/08). Try adjusting the forecast point to an earlier date or appending new future rows to the data."} No empty rows were provided to predict on.
400 BAD REQUEST {"message": "No valid output rows"} No historic information was provided; there's only 1 row to predict on.
400 BAD REQUEST {"message": "The \"Time\" feature contains the value 'OCT-27', which does not match the original format %m/%d/%y (e.g., '06/24/19'). To upload this data, first correct the format in your prediction dataset and then try the import again. Because some software automatically converts the format for display, it is best to check the actual format using a text editor."} Prediction row has a different format than the rest of the data.
400 BAD REQUEST {"message": "The following errors are found:\n • The prediction data must contain historical values spanning more than 35 day(s) into the past. In addition, the target cannot have missing values or missing rows which are used for differencing"} Provided dataset has fewer than the required 35 rows of historical data.
400 BAD REQUEST {"message": {"forecastPoint": "Invalid RFC 3339 datetime string: "}} Provided an empty or non-valid forecastPoint.
404 NOT FOUND {"message": "Deployment :deploymentId cannot be found for user :userId"} Deployment was removed or doesn’t exist.
422 UNPROCESSABLE ENTITY {"message": "Predictions on models that are not time series models are not supported on this endpoint. Please use the predict endpoint instead."} Provided deploymentId that is not for a time series project.
422 UNPROCESSABLE ENTITY {"message": {"relaxKnownInAdvanceFeaturesCheck": "value can't be converted to Bool"}} Provided an empty or non-valid value for relaxKnownInAdvanceFeaturesCheck'.

Updated November 26, 2021
Back to top