Skip to content

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

Batch Prediction job definitions

To submit a working Batch Prediction job, you must supply a variety of elements to the POST request payload depending on what type of prediction is required. Additionally, you must consider the type of intake and output adapters used for a given job.

Every time a new Batch Prediction is created, the same amount of information must be stored somewhere outside of DataRobot and re-submitted every time. As described in detail in the sample use cases section, one such request could be as follows:

POST https://app.datarobot.com/api/v2/batchPredictions

{
    "deploymentId": "<deployment_id>",
    "intakeSettings": {
        "type": "dataset",
        "datasetId": "<dataset_ud>"
    },
    "outputSettings": {
        "type": "jdbc",
        "statementType": "insert",
        "credentialId": "<credential_id>",
        "dataStoreId": "<data_store_id>",
        "schema": "public",
        "table": "example_table",
        "createTableIfNotExists": false
    },
    "includeProbabilities": true,
    "includePredictionStatus": true,
    "passthroughColumnsSet": "all"
}

Job Definitions API

If your use case requires the same, or close to the same, type of prediction to be done multiple times, you can choose to create a Job Definition of the Batch Prediction job and store this inside DataRobot for future use.

The API for job definitions is identical to the existing /batchPredictions/ endpoint, and can be used interchangeably by changing the POST endpoint to /batchPredictionJobDefinitions:

POST https://app.datarobot.com/api/v2/batchPredictionJobDefinitions

{
    "deploymentId": "<deployment_id>",
    "intakeSettings": {
        "type": "dataset",
        "datasetId": "<dataset_ud>"
    },
    "outputSettings": {
        "type": "jdbc",
        "statementType": "insert",
        "credentialId": "<credential_id>",
        "dataStoreId": "<data_store_id>",
        "schema": "public",
        "table": "example_table",
        "createTableIfNotExists": false
    },
    "includeProbabilities": true,
    "includePredictionStatus": true,
    "passthroughColumnsSet": "all"
}

This definition endpoint will return an accepted payload that verifies the successful storing of the definition to DataRobot.

Optionally, you can supply a name parameter for easier identification. If you don't supply one, DataRobot will create one for you.

Warning

The name parameter must be unique across your organization. If you attempt to create multiple definitions with the same name, the request will fail. If you wish to free up a name, you must first send a DELETE request with the existing job definition ID you wish to delete.

Execute a Job Definition

If you wish to submit a stored job definition for scoring, you can either choose to do so on a scheduled basis, described here, or by manually submitting the definition ID to the endpoint /batchPredictions/fromJobDefinition and with the definition ID as the payload, as such:

POST https://app.datarobot.com/api/v2/batchPredictions/fromJobDefinition

{
    "id": "<job_definition_id>"
}

The endpoint supports regular the CRUD operations, GET, POST, DELETE and PATCH.


Updated September 2, 2021
Back to top