Skip to main content

batch_predictions

Creates, updates, deletes, gets or lists a batch_predictions resource.

Overview

Namebatch_predictions
TypeResource
Idaws.machinelearning.batch_predictions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
batch_prediction_data_source_idstringThe ID of the DataSource that was used to create the BatchPrediction. (pattern: <code>[a-zA-Z0-9_.-]+</code>)
batch_prediction_idstringAn ID assigned to the BatchPrediction at creation. This value should be identical to the value of the BatchPredictionID in the request. (pattern: <code>[a-zA-Z0-9_.-]+</code>)
compute_timeinteger (int64)Long integer type that is a 64-bit signed number.
created_atstring (date-time)A timestamp represented in epoch time.
created_by_iam_userstringThe AWS user account that invoked the BatchPrediction. The account type can be either an AWS root account or an AWS Identity and Access Management (IAM) user account. (pattern: <code>arn:aws:iam::[0-9]+:((user/.+)|(root))</code>)
finished_atstring (date-time)A timestamp represented in epoch time.
input_data_location_s3stringThe location of the data file or directory in Amazon Simple Storage Service (Amazon S3). (pattern: <code>s3:​//([^/]+)(/.*)?</code>)
invalid_record_countinteger (int64)Long integer type that is a 64-bit signed number.
last_updated_atstring (date-time)A timestamp represented in epoch time.
log_uristringA link to the file that contains logs of the CreateBatchPrediction operation.
ml_model_idstringThe ID of the MLModel that generated predictions for the BatchPrediction request. (pattern: <code>[a-zA-Z0-9_.-]+</code>)
messagestringA description of the most recent details about processing the batch prediction request.
namestringA user-supplied name or description of the BatchPrediction. (pattern: <code>.\S.|^$</code>)
output_uristringThe location of an Amazon S3 bucket or directory to receive the operation results. (pattern: <code>s3:​//([^/]+)(/.*)?</code>)
started_atstring (date-time)A timestamp represented in epoch time.
statusstringThe status of the BatchPrediction, which can be one of the following values: PENDING - Amazon Machine Learning (Amazon ML) submitted a request to generate batch predictions. INPROGRESS - The batch predictions are in progress. FAILED - The request to perform a batch prediction did not run to completion. It is not usable. COMPLETED - The batch prediction process completed successfully. DELETED - The BatchPrediction is marked as deleted. It is not usable. (PENDING, INPROGRESS, FAILED, COMPLETED, DELETED)
total_record_countinteger (int64)Long integer type that is a 64-bit signed number.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_batch_predictionselectregionReturns a BatchPrediction that includes detailed metadata, status, and data file information for a Batch Prediction request.
describe_batch_predictionsselectregionReturns a list of BatchPrediction operations that match the search criteria in the request.
create_batch_predictioninsertregion, BatchPredictionId, MLModelId, BatchPredictionDataSourceId, OutputUriGenerates predictions for a group of observations. The observations to process exist in one or more data files referenced by a DataSource. This operation creates a new BatchPrediction, and uses an MLModel and the data files referenced by the DataSource as information sources. CreateBatchPrediction is an asynchronous operation. In response to CreateBatchPrediction, Amazon Machine Learning (Amazon ML) immediately returns and sets the BatchPrediction status to PENDING. After the BatchPrediction completes, Amazon ML sets the status to COMPLETED. You can poll for status updates by using the GetBatchPrediction operation and checking the Status parameter of the result. After the COMPLETED status appears, the results are available in the location specified by the OutputUri parameter.
update_batch_predictionupdateregion, BatchPredictionId, BatchPredictionNameUpdates the BatchPredictionName of a BatchPrediction. You can use the GetBatchPrediction operation to view the contents of the updated data element.
delete_batch_predictiondeleteregionAssigns the DELETED status to a BatchPrediction, rendering it unusable. After using the DeleteBatchPrediction operation, you can use the GetBatchPrediction operation to verify that the status of the BatchPrediction changed to DELETED. Caution: The result of the DeleteBatchPrediction operation is irreversible.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns a BatchPrediction that includes detailed metadata, status, and data file information for a Batch Prediction request.

SELECT
batch_prediction_data_source_id,
batch_prediction_id,
compute_time,
created_at,
created_by_iam_user,
finished_at,
input_data_location_s3,
invalid_record_count,
last_updated_at,
log_uri,
ml_model_id,
message,
name,
output_uri,
started_at,
status,
total_record_count
FROM aws.machinelearning.batch_predictions
WHERE region = '{{ region }}' -- required
;

INSERT examples

Generates predictions for a group of observations. The observations to process exist in one or more data files referenced by a DataSource. This operation creates a new BatchPrediction, and uses an MLModel and the data files referenced by the DataSource as information sources. CreateBatchPrediction is an asynchronous operation. In response to CreateBatchPrediction, Amazon Machine Learning (Amazon ML) immediately returns and sets the BatchPrediction status to PENDING. After the BatchPrediction completes, Amazon ML sets the status to COMPLETED. You can poll for status updates by using the GetBatchPrediction operation and checking the Status parameter of the result. After the COMPLETED status appears, the results are available in the location specified by the OutputUri parameter.

INSERT INTO aws.machinelearning.batch_predictions (
BatchPredictionId,
BatchPredictionName,
MLModelId,
BatchPredictionDataSourceId,
OutputUri,
region
)
SELECT
'{{ BatchPredictionId }}' /* required */,
'{{ BatchPredictionName }}',
'{{ MLModelId }}' /* required */,
'{{ BatchPredictionDataSourceId }}' /* required */,
'{{ OutputUri }}' /* required */,
'{{ region }}'
RETURNING
batch_prediction_id
;

UPDATE examples

Updates the BatchPredictionName of a BatchPrediction. You can use the GetBatchPrediction operation to view the contents of the updated data element.

UPDATE aws.machinelearning.batch_predictions
SET
BatchPredictionId = '{{ BatchPredictionId }}',
BatchPredictionName = '{{ BatchPredictionName }}'
WHERE
region = '{{ region }}' --required
AND BatchPredictionId = '{{ BatchPredictionId }}' --required
AND BatchPredictionName = '{{ BatchPredictionName }}' --required
RETURNING
batch_prediction_id;

DELETE examples

Assigns the DELETED status to a BatchPrediction, rendering it unusable. After using the DeleteBatchPrediction operation, you can use the GetBatchPrediction operation to verify that the status of the BatchPrediction changed to DELETED. Caution: The result of the DeleteBatchPrediction operation is irreversible.

DELETE FROM aws.machinelearning.batch_predictions
WHERE region = '{{ region }}' --required
;