Run batch prediction
run_batch_predictionScore an entire dataset against a trained model version by starting a batch job; use the returned prediction ID to poll status and download scored results.
Instructions
Score an entire dataset against a trained model version.
Each call starts a new batch job and spends one prediction credit per row;
get_prediction follows one already started, by its prediction_id.
Name the model one way: model_version_id for an exact version, or
model_id + alias (such as production) for whichever version the
alias points to. Prefer the alias for recurring scoring, so the user can
promote a new version with set_model_alias without changing the calls;
validate a candidate by its model_version_id. The result's
modelVersionId is the version that actually scored, and alias echoes
the alias that resolved it; report that version next to the output.
project_id and target_feature are auto-resolved from the model version
record when omitted. dataset_version_id identifies both the input file and
the row count for credit billing (one prediction credit per row).
Holdout validation: score your test dataset version with its labels
still in it. The CSV you download via get_prediction is that file in its
original row order with every column kept (target and ids included), plus
prediction and, for classifiers, one probability_<class> column per
class (probability_1 is the positive class for a 0/1 target); compute
the holdout metrics and decision threshold yourself from it, since
EasyDeploy does not return them. For a string target the probability
columns are named by encoded class index (probability_0,
probability_1, ... in sorted label order), not by label; the completed
prediction's classLabels, from get_prediction, maps each index to its
label. Columns the
model was not trained on, such as ids, are ignored for scoring and kept in
the output, so leave them in to join results back; every training feature
must be present or the job fails naming the missing one. The download
is capped at 9 MB, so keep test files small enough that their scored output
fits, or split the test set across several batches.
Returns immediately by default (fire-and-poll). get_prediction(prediction_id)
reports the status; for a completed batch it also has
batch_output_available: true, download_url and curl_command.
Set wait_for_result=true to block for
max_wait_seconds (45 s by default, at most 60 s); if the batch is still
running then, the result has timed_out: true and next_steps: poll
get_prediction to keep waiting.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alias | No | With model_id: score with the version this alias (such as 'production') points to when the call runs. Leave empty when passing model_version_id. | |
| model_id | No | With alias: the model whose alias picks the version. Leave empty when passing model_version_id. | |
| project_id | No | ||
| target_feature | No | ||
| wait_for_result | No | ||
| max_wait_seconds | No | With wait_for_result=true, how long to wait, in seconds (default 45, at most 60; larger values are clamped). Hosts end long tool calls at different times, some at 60 s, so the default returns well before that; poll get_prediction to keep waiting. | |
| model_version_id | No | The exact model version to score with. Leave empty when naming the model by model_id + alias instead. | |
| dataset_version_id | Yes | ||
| poll_interval_seconds | No | Seconds between status checks while waiting (default 5.0). Values below 2 are raised to 2. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||