GetBatchPrediction
Returns a BatchPrediction that includes detailed metadata, status, and data file information for a
Batch Prediction request.
Request Syntax
{
"BatchPredictionId": "string"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- BatchPredictionId
-
An ID assigned to the
BatchPredictionat creation.Type: String
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
[a-zA-Z0-9_.-]+Required: Yes
Response Syntax
{
"BatchPredictionDataSourceId": "string",
"BatchPredictionId": "string",
"ComputeTime": number,
"CreatedAt": number,
"CreatedByIamUser": "string",
"FinishedAt": number,
"InputDataLocationS3": "string",
"InvalidRecordCount": number,
"LastUpdatedAt": number,
"LogUri": "string",
"Message": "string",
"MLModelId": "string",
"Name": "string",
"OutputUri": "string",
"StartedAt": number,
"Status": "string",
"TotalRecordCount": number
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- BatchPredictionDataSourceId
-
The ID of the
DataSourcethat was used to create theBatchPrediction.Type: String
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
[a-zA-Z0-9_.-]+ - BatchPredictionId
-
An ID assigned to the
BatchPredictionat creation. This value should be identical to the value of theBatchPredictionIDin the request.Type: String
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
[a-zA-Z0-9_.-]+ - ComputeTime
-
The approximate CPU time in milliseconds that Amazon Machine Learning spent processing the
BatchPrediction, normalized and scaled on computation resources.ComputeTimeis only available if theBatchPredictionis in theCOMPLETEDstate.Type: Long
- CreatedAt
-
The time when the
BatchPredictionwas created. The time is expressed in epoch time.Type: Timestamp
- CreatedByIamUser
-
The 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.Type: String
Pattern:
arn:aws:iam::[0-9]+:((user/.+)|(root)) - FinishedAt
-
The epoch time when Amazon Machine Learning marked the
BatchPredictionasCOMPLETEDorFAILED.FinishedAtis only available when theBatchPredictionis in theCOMPLETEDorFAILEDstate.Type: Timestamp
- InputDataLocationS3
-
The location of the data file or directory in Amazon Simple Storage Service (Amazon S3).
Type: String
Length Constraints: Maximum length of 2048.
Pattern:
s3://([^/]+)(/.*)? - InvalidRecordCount
-
The number of invalid records that Amazon Machine Learning saw while processing the
BatchPrediction.Type: Long
- LastUpdatedAt
-
The time of the most recent edit to
BatchPrediction. The time is expressed in epoch time.Type: Timestamp
- LogUri
-
A link to the file that contains logs of the
CreateBatchPredictionoperation.Type: String
- Message
-
A description of the most recent details about processing the batch prediction request.
Type: String
Length Constraints: Maximum length of 10240.
- MLModelId
-
The ID of the
MLModelthat generated predictions for theBatchPredictionrequest.Type: String
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
[a-zA-Z0-9_.-]+ - Name
-
A user-supplied name or description of the
BatchPrediction.Type: String
Length Constraints: Maximum length of 1024.
Pattern:
.*\S.*|^$ - OutputUri
-
The location of an Amazon S3 bucket or directory to receive the operation results.
Type: String
Length Constraints: Maximum length of 2048.
Pattern:
s3://([^/]+)(/.*)? - StartedAt
-
The epoch time when Amazon Machine Learning marked the
BatchPredictionasINPROGRESS.StartedAtisn't available if theBatchPredictionis in thePENDINGstate.Type: Timestamp
- Status
-
The 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- TheBatchPredictionis marked as deleted. It is not usable.
Type: String
Valid Values:
PENDING | INPROGRESS | FAILED | COMPLETED | DELETED -
- TotalRecordCount
-
The number of total records that Amazon Machine Learning saw while processing the
BatchPrediction.Type: Long
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalServerException
-
An error on the server occurred when trying to process a request.
HTTP Status Code: 500
- InvalidInputException
-
An error on the client occurred. Typically, the cause is an invalid input value.
HTTP Status Code: 400
- ResourceNotFoundException
-
A specified resource cannot be located.
HTTP Status Code: 400
Examples
The following is a sample request and response of the GetBatchPrediction operation.
This example illustrates one usage of GetBatchPrediction.
Sample Request
POST / HTTP/1.1
Host: machinelearning.<region>.<domain>
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid,Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: AmazonML_20141212.GetBatchPrediction
{"BatchPredictionId": "EXAMPLE-bp-2014-09-12-15-14-04-156"}
Sample Response
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
"BatchPredictionDataSourceId":"EXAMPLE-tr-ds-2014-09-12-15-14-04-989",
"BatchPredictionId":"EXAMPLE-bp-2014-09-12-15-14-04-156",
"CreatedAt":1410560632.327,
"CreatedByIamUser":"arn:aws:iam::<awsAccountId>:user/user",
"InputDataLocationS3": "s3://eml-test-EXAMPLE/example.csv",
"LastUpdatedAt":1410560632.327,
"LogUri": "https://s3bucket/locationToLogs/logname.tar.gz",
"Name":"EXAMPLE",
"OutputUri":"s3://eml-test-EXAMPLE/test-outputs/EXAMPLE-bp-2014-09-12-15-14-04-156/results",
"MLModelId":"EXAMPLE-pr-2014-09-12-15-14-04-924",
"Status":"COMPLETED",
"ComputeTime":"185200",
"FinishedAt":1410560632.327,
"StartedAt":1410560632.327,
"TotalRecordCount":"21154",
"InvalidRecordCount":"0"
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: