Run batch prediction
run_batch_predictionScore an entire dataset against a trained model version by starting a batch prediction job; poll for completion or wait for 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.
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 |
|---|---|---|---|
| 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 | Yes | ||
| 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 | |||