REST Resource: projects.locations.batchPredictionJobs

Resource: BatchPredictionJob

A job that uses a Model to produce predictions on multiple input instances. If predictions for significant portion of the instances fail, the job may finish without attempting predictions for all remaining instances.

JSON representation
{
  "name": string,
  "displayName": string,
  "model": string,
  "inputConfig": {
    object (InputConfig)
  },
  "modelParameters": value,
  "outputConfig": {
    object (OutputConfig)
  },
  "dedicatedResources": {
    object (BatchDedicatedResources)
  },
  "manualBatchTuningParameters": {
    object (ManualBatchTuningParameters)
  },
  "generateExplanation": boolean,
  "explanationSpec": {
    object (ExplanationSpec)
  },
  "outputInfo": {
    object (OutputInfo)
  },
  "state": enum (JobState),
  "error": {
    object (Status)
  },
  "partialFailures": [
    {
      object (Status)
    }
  ],
  "resourcesConsumed": {
    object (ResourcesConsumed)
  },
  "completionStats": {
    object (CompletionStats)
  },
  "createTime": string,
  "startTime": string,
  "endTime": string,
  "updateTime": string,
  "labels": {
    string: string,
    ...
  },
  "encryptionSpec": {
    object (EncryptionSpec)
  }
}
Fields
name

string

Output only. Resource name of the BatchPredictionJob.

displayName

string

Required. The user-defined name of this BatchPredictionJob.

model

string

Required. The name of the Model that produces the predictions via this job, must share the same ancestor Location. Starting this job has no impact on any existing deployments of the Model and their resources.

inputConfig

object (InputConfig)

Required. Input configuration of the instances on which predictions are performed. The schema of any single instance may be specified via the Model's PredictSchemata's instanceSchemaUri.

modelParameters

value (Value format)

The parameters that govern the predictions. The schema of the parameters may be specified via the Model's PredictSchemata's parametersSchemaUri.

outputConfig

object (OutputConfig)

Required. The Configuration specifying where output predictions should be written. The schema of any single prediction may be specified as a concatenation of Model's PredictSchemata's instanceSchemaUri and predictionSchemaUri.

dedicatedResources

object (BatchDedicatedResources)

The config of resources used by the Model during the batch prediction. If the Model supports DEDICATED_RESOURCES this config may be provided (and the job will use these resources), if the Model doesn't support AUTOMATIC_RESOURCES, this config must be provided.

manualBatchTuningParameters

object (ManualBatchTuningParameters)

Immutable. Parameters configuring the batch behavior. Currently only applicable when dedicatedResources are used (in other cases Vertex AI does the tuning itself).

generateExplanation

boolean

Generate explanation with the batch prediction results.

When set to true, the batch prediction output changes based on the predictionsFormat field of the BatchPredictionJob.output_config object:

  • bigquery: output includes a column named explanation. The value is a struct that conforms to the Explanation object.
  • jsonl: The JSON objects on each line include an additional entry keyed explanation. The value of the entry is a JSON object that conforms to the Explanation object.
  • csv: Generating explanations for CSV format is not supported.

If this field is set to true, either the Model.explanation_spec or explanationSpec must be populated.

explanationSpec

object (ExplanationSpec)

Explanation configuration for this BatchPredictionJob. Can be specified only if generateExplanation is set to true.

This value overrides the value of Model.explanation_spec. All fields of explanationSpec are optional in the request. If a field of the explanationSpec object is not populated, the corresponding field of the Model.explanation_spec object is inherited.

outputInfo

object (OutputInfo)

Output only. Information further describing the output of this job.

state

enum (JobState)

Output only. The detailed state of the job.

error

object (Status)

Output only. Only populated when the job's state is JOB_STATE_FAILED or JOB_STATE_CANCELLED.

partialFailures[]

object (Status)

Output only. Partial failures encountered. For example, single files that can't be read. This field never exceeds 20 entries. Status details fields contain standard GCP error details.

resourcesConsumed

object (ResourcesConsumed)

Output only. Information about resources that had been consumed by this job. Provided in real time at best effort basis, as well as a final value once the job completes.

Note: This field currently may be not populated for batch predictions that use AutoML Models.

completionStats

object (CompletionStats)

Output only. Statistics on completed and failed prediction instances.

createTime

string (Timestamp format)

Output only. Time when the BatchPredictionJob was created.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

startTime

string (Timestamp format)

Output only. Time when the BatchPredictionJob for the first time entered the JOB_STATE_RUNNING state.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

endTime

string (Timestamp format)

Output only. Time when the BatchPredictionJob entered any of the following states: JOB_STATE_SUCCEEDED, JOB_STATE_FAILED, JOB_STATE_CANCELLED.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. Time when the BatchPredictionJob was most recently updated.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

labels

map (key: string, value: string)

The labels with user-defined metadata to organize BatchPredictionJobs.

Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed.

See https://goo.gl/xmQnxf for more information and examples of labels.

encryptionSpec

object (EncryptionSpec)

Customer-managed encryption key options for a BatchPredictionJob. If this is set, then all resources created by the BatchPredictionJob will be encrypted with the provided encryption key.

InputConfig

Configures the input to BatchPredictionJob. See Model.supported_input_storage_formats for Model's supported input formats, and how instances should be expressed via any of them.

JSON representation
{
  "instancesFormat": string,

  // Union field source can be only one of the following:
  "gcsSource": {
    object (GcsSource)
  },
  "bigquerySource": {
    object (BigQuerySource)
  }
  // End of list of possible types for union field source.
}
Fields
instancesFormat

string

Required. The format in which instances are given, must be one of the Model's supportedInputStorageFormats.

Union field source. Required. The source of the input. source can be only one of the following:
gcsSource

object (GcsSource)

The Cloud Storage location for the input instances.

bigquerySource

object (BigQuerySource)

The BigQuery location of the input table. The schema of the table should be in the format described by the given context OpenAPI Schema, if one is provided. The table may contain additional columns that are not described by the schema, and they will be ignored.

OutputConfig

Configures the output of BatchPredictionJob. See Model.supported_output_storage_formats for supported output formats, and how predictions are expressed via any of them.

JSON representation
{
  "predictionsFormat": string,

  // Union field destination can be only one of the following:
  "gcsDestination": {
    object (GcsDestination)
  },
  "bigqueryDestination": {
    object (BigQueryDestination)
  }
  // End of list of possible types for union field destination.
}
Fields
predictionsFormat

string

Required. The format in which Vertex AI gives the predictions, must be one of the Model's supportedOutputStorageFormats.

Union field destination. Required. The destination of the output. destination can be only one of the following:
gcsDestination

object (GcsDestination)

The Cloud Storage location of the directory where the output is to be written to. In the given directory a new directory is created. Its name is prediction-<model-display-name>-<job-create-time>, where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. Inside of it files predictions_0001.<extension>, predictions_0002.<extension>, ..., predictions_N.<extension> are created where <extension> depends on chosen predictionsFormat, and N may equal 0001 and depends on the total number of successfully predicted instances. If the Model has both instance and prediction schemata defined then each such file contains predictions as per the predictionsFormat. If prediction for any instance failed (partially or completely), then an additional errors_0001.<extension>, errors_0002.<extension>,..., errors_N.<extension> files are created (N depends on total number of failed predictions). These files contain the failed instances, as per their schema, followed by an additional error field which as value has google.rpc.Status containing only code and message fields.

bigqueryDestination

object (BigQueryDestination)

The BigQuery project or dataset location where the output is to be written to. If project is provided, a new dataset is created with name prediction_<model-display-name>_<job-create-time> where is made BigQuery-dataset-name compatible (for example, most special characters become underscores), and timestamp is in YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset two tables will be created, predictions, and errors. If the Model has both instance and prediction schemata defined then the tables have columns as follows: The predictions table contains instances for which the prediction succeeded, it has columns as per a concatenation of the Model's instance and prediction schemata. The errors table contains rows for which the prediction has failed, it has instance columns, as per the instance schema, followed by a single "errors" column, which as values has google.rpc.Status represented as a STRUCT, and containing only code and message.

BatchDedicatedResources

A description of resources that are used for performing batch operations, are dedicated to a Model, and need manual configuration.

JSON representation
{
  "machineSpec": {
    object (MachineSpec)
  },
  "startingReplicaCount": integer,
  "maxReplicaCount": integer
}
Fields
machineSpec

object (MachineSpec)

Required. Immutable. The specification of a single machine.

startingReplicaCount

integer

Immutable. The number of machine replicas used at the start of the batch operation. If not set, Vertex AI decides starting number, not greater than maxReplicaCount

maxReplicaCount

integer

Immutable. The maximum number of machine replicas the batch operation may be scaled to. The default value is 10.

ManualBatchTuningParameters

Manual batch tuning parameters.

JSON representation
{
  "batchSize": integer
}
Fields
batchSize

integer

Immutable. The number of the records (e.g. instances) of the operation given in each batch to a machine replica. Machine type, and size of a single record should be considered when setting this parameter, higher value speeds up the batch operation's execution, but too high value will result in a whole batch not fitting in a machine's memory, and the whole operation will fail. The default value is 4.

OutputInfo

Further describes this job's output. Supplements outputConfig.

JSON representation
{
  "bigqueryOutputTable": string,

  // Union field output_location can be only one of the following:
  "gcsOutputDirectory": string,
  "bigqueryOutputDataset": string
  // End of list of possible types for union field output_location.
}
Fields
bigqueryOutputTable

string

Output only. The name of the BigQuery table created, in predictions_<timestamp> format, into which the prediction output is written. Can be used by UI to generate the BigQuery output path, for example.

Union field output_location. The output location into which prediction output is written. output_location can be only one of the following:
gcsOutputDirectory

string

Output only. The full path of the Cloud Storage directory created, into which the prediction output is written.

bigqueryOutputDataset

string

Output only. The path of the BigQuery dataset created, in bq://projectId.bqDatasetId format, into which the prediction output is written.

ResourcesConsumed

Statistics information about resource consumption.

JSON representation
{
  "replicaHours": number
}
Fields
replicaHours

number

Output only. The number of replica hours used. Note that many replicas may run in parallel, and additionally any given work may be queued for some time. Therefore this value is not strictly related to wall time.

CompletionStats

Success and error statistics of processing multiple entities (for example, DataItems or structured data rows) in batch.

JSON representation
{
  "successfulCount": string,
  "failedCount": string,
  "incompleteCount": string
}
Fields
successfulCount

string (int64 format)

Output only. The number of entities that had been processed successfully.

failedCount

string (int64 format)

Output only. The number of entities for which any error was encountered.

incompleteCount

string (int64 format)

Output only. In cases when enough errors are encountered a job, pipeline, or operation may be failed as a whole. Below is the number of entities for which the processing had not been finished (either in successful or failed state). Set to -1 if the number is unknown (for example, the operation failed before the total entity number could be collected).

Methods

cancel

Cancels a BatchPredictionJob.

create

Creates a BatchPredictionJob.

delete

Deletes a BatchPredictionJob.

get

Gets a BatchPredictionJob

list

Lists BatchPredictionJobs in a Location.