• 沒有找到結果。

API ReferenceAPI Version 2014-12-12 MachineLearning

N/A
N/A
Protected

Academic year: 2022

Share "API ReferenceAPI Version 2014-12-12 MachineLearning"

Copied!
169
0
0

加載中.... (立即查看全文)

全文

(1)

MachineLearning

API Reference

API Version 2014-12-12

(2)

MachineLearning: API Reference

Copyright © Amazon Web Services, Inc. and/or its affiliates. All rights reserved.

Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon.

(3)

Table of Contents

Welcome ... 1

Actions ... 2

AddTags ... 3

Request Syntax ... 3

Request Parameters ... 3

Response Syntax ... 4

Response Elements ... 4

Errors ... 4

Examples ... 5

See Also ... 5

CreateBatchPrediction ... 7

Request Syntax ... 7

Request Parameters ... 7

Response Syntax ... 8

Response Elements ... 8

Errors ... 9

Examples ... 9

See Also ... 10

CreateDataSourceFromRDS ... 11

Request Syntax ... 11

Request Parameters ... 11

Response Syntax ... 13

Response Elements ... 13

Errors ... 13

Examples ... 14

See Also ... 15

CreateDataSourceFromRedshift ... 16

Request Syntax ... 16

Request Parameters ... 16

Response Syntax ... 18

Response Elements ... 18

Errors ... 18

Examples ... 19

See Also ... 19

CreateDataSourceFromS3 ... 21

Request Syntax ... 21

Request Parameters ... 21

Response Syntax ... 22

Response Elements ... 22

Errors ... 23

Examples ... 23

See Also ... 24

CreateEvaluation ... 25

Request Syntax ... 25

Request Parameters ... 25

Response Syntax ... 26

Response Elements ... 26

Errors ... 26

Examples ... 27

See Also ... 27

CreateMLModel ... 29

Request Syntax ... 29

Request Parameters ... 29

Response Syntax ... 31

(4)

Response Elements ... 31

Errors ... 31

Examples ... 32

See Also ... 32

CreateRealtimeEndpoint ... 34

Request Syntax ... 34

Request Parameters ... 34

Response Syntax ... 34

Response Elements ... 34

Errors ... 35

Examples ... 35

See Also ... 36

DeleteBatchPrediction ... 37

Request Syntax ... 37

Request Parameters ... 37

Response Syntax ... 37

Response Elements ... 37

Errors ... 38

Examples ... 38

See Also ... 38

DeleteDataSource ... 40

Request Syntax ... 40

Request Parameters ... 40

Response Syntax ... 40

Response Elements ... 40

Errors ... 41

Examples ... 41

See Also ... 41

DeleteEvaluation ... 43

Request Syntax ... 43

Request Parameters ... 43

Response Syntax ... 43

Response Elements ... 43

Errors ... 44

Examples ... 44

See Also ... 44

DeleteMLModel ... 46

Request Syntax ... 46

Request Parameters ... 46

Response Syntax ... 46

Response Elements ... 46

Errors ... 47

Examples ... 47

See Also ... 47

DeleteRealtimeEndpoint ... 49

Request Syntax ... 49

Request Parameters ... 49

Response Syntax ... 49

Response Elements ... 49

Errors ... 50

Examples ... 50

See Also ... 51

DeleteTags ... 52

Request Syntax ... 52

Request Parameters ... 52

Response Syntax ... 53

Response Elements ... 53

(5)

Errors ... 53

Examples ... 54

See Also ... 54

DescribeBatchPredictions ... 55

Request Syntax ... 55

Request Parameters ... 55

Response Syntax ... 57

Response Elements ... 58

Errors ... 58

Examples ... 58

See Also ... 59

DescribeDataSources ... 61

Request Syntax ... 61

Request Parameters ... 61

Response Syntax ... 63

Response Elements ... 64

Errors ... 64

Examples ... 65

See Also ... 66

DescribeEvaluations ... 67

Request Syntax ... 67

Request Parameters ... 67

Response Syntax ... 69

Response Elements ... 70

Errors ... 70

Examples ... 70

See Also ... 71

DescribeMLModels ... 73

Request Syntax ... 73

Request Parameters ... 73

Response Syntax ... 75

Response Elements ... 76

Errors ... 76

Examples ... 77

See Also ... 78

DescribeTags ... 79

Request Syntax ... 79

Request Parameters ... 79

Response Syntax ... 79

Response Elements ... 79

Errors ... 80

Examples ... 80

See Also ... 81

GetBatchPrediction ... 82

Request Syntax ... 82

Request Parameters ... 82

Response Syntax ... 82

Response Elements ... 82

Errors ... 85

Examples ... 85

See Also ... 86

GetDataSource ... 87

Request Syntax ... 87

Request Parameters ... 87

Response Syntax ... 87

Response Elements ... 88

Errors ... 90

(6)

Examples ... 91

See Also ... 92

GetEvaluation ... 93

Request Syntax ... 93

Request Parameters ... 93

Response Syntax ... 93

Response Elements ... 93

Errors ... 96

Examples ... 96

See Also ... 97

GetMLModel ... 98

Request Syntax ... 98

Request Parameters ... 98

Response Syntax ... 98

Response Elements ... 99

Errors ... 102

Examples ... 103

See Also ... 104

Predict ... 105

Request Syntax ... 105

Request Parameters ... 105

Response Syntax ... 105

Response Elements ... 106

Errors ... 106

Examples ... 107

See Also ... 107

UpdateBatchPrediction ... 109

Request Syntax ... 109

Request Parameters ... 109

Response Syntax ... 109

Response Elements ... 109

Errors ... 110

Examples ... 110

See Also ... 111

UpdateDataSource ... 112

Request Syntax ... 112

Request Parameters ... 112

Response Syntax ... 112

Response Elements ... 112

Errors ... 113

Examples ... 113

See Also ... 114

UpdateEvaluation ... 115

Request Syntax ... 115

Request Parameters ... 115

Response Syntax ... 115

Response Elements ... 115

Errors ... 116

Examples ... 116

See Also ... 117

UpdateMLModel ... 118

Request Syntax ... 118

Request Parameters ... 118

Response Syntax ... 119

Response Elements ... 119

Errors ... 119

Examples ... 119

(7)

See Also ... 120

Data Types ... 121

BatchPrediction ... 122

Contents ... 122

See Also ... 124

DataSource ... 125

Contents ... 125

See Also ... 127

Evaluation ... 128

Contents ... 128

See Also ... 130

MLModel ... 131

Contents ... 131

See Also ... 134

PerformanceMetrics ... 135

Contents ... 135

See Also ... 135

Prediction ... 136

Contents ... 136

See Also ... 136

RDSDatabase ... 138

Contents ... 138

See Also ... 138

RDSDatabaseCredentials ... 139

Contents ... 139

See Also ... 139

RDSDataSpec ... 140

Contents ... 140

See Also ... 143

RDSMetadata ... 144

Contents ... 144

See Also ... 145

RealtimeEndpointInfo ... 146

Contents ... 146

See Also ... 146

RedshiftDatabase ... 148

Contents ... 148

See Also ... 148

RedshiftDatabaseCredentials ... 149

Contents ... 149

See Also ... 149

RedshiftDataSpec ... 150

Contents ... 150

See Also ... 152

RedshiftMetadata ... 154

Contents ... 154

See Also ... 154

S3DataSpec ... 155

Contents ... 155

See Also ... 157

Tag ... 158

Contents ... 158

See Also ... 158

Common Parameters ... 159

Common Errors ... 161

(8)

Welcome

Definition of the public APIs exposed by Amazon Machine Learning This document was last published on March 6, 2022.

(9)

Actions

The following actions are supported:

• AddTags (p. 3)

• CreateBatchPrediction (p. 7)

• CreateDataSourceFromRDS (p. 11)

• CreateDataSourceFromRedshift (p. 16)

• CreateDataSourceFromS3 (p. 21)

• CreateEvaluation (p. 25)

• CreateMLModel (p. 29)

• CreateRealtimeEndpoint (p. 34)

• DeleteBatchPrediction (p. 37)

• DeleteDataSource (p. 40)

• DeleteEvaluation (p. 43)

• DeleteMLModel (p. 46)

• DeleteRealtimeEndpoint (p. 49)

• DeleteTags (p. 52)

• DescribeBatchPredictions (p. 55)

• DescribeDataSources (p. 61)

• DescribeEvaluations (p. 67)

• DescribeMLModels (p. 73)

• DescribeTags (p. 79)

• GetBatchPrediction (p. 82)

• GetDataSource (p. 87)

• GetEvaluation (p. 93)

• GetMLModel (p. 98)

• Predict (p. 105)

• UpdateBatchPrediction (p. 109)

• UpdateDataSource (p. 112)

• UpdateEvaluation (p. 115)

• UpdateMLModel (p. 118)

(10)

AddTags

AddTags

Adds one or more tags to an object, up to a limit of 10. Each tag consists of a key and an optional value.

If you add a tag using a key that is already associated with the ML object, AddTags updates the tag's value.

Request Syntax

{

"ResourceId": "string", "ResourceType": "string", "Tags": [

{

"Key": "string", "Value": "string"

} ] }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters (p. 159).

The request accepts the following data in JSON format.

ResourceId (p. 3)

The ID of the ML object to tag. For example, exampleModelId.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes ResourceType (p. 3)

The type of the ML object to tag.

Type: String

Valid Values: BatchPrediction | DataSource | Evaluation | MLModel Required: Yes

Tags (p. 3)

The key-value pairs to use to create tags. If you specify a key without specifying a value, Amazon ML creates a tag with the specified key and a value of null.

Type: Array of Tag (p. 158) objects

Array Members: Maximum number of 100 items.

Required: Yes

(11)

Response Syntax

Response Syntax

{ "ResourceId": "string", "ResourceType": "string"

}

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.

ResourceId (p. 4)

The ID of the ML object that was tagged.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

ResourceType (p. 4)

The type of the ML object that was tagged.

Type: String

Valid Values: BatchPrediction | DataSource | Evaluation | MLModel

Errors

For information about the errors that are common to all actions, see Common Errors (p. 161).

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 InvalidTagException

A submitted tag is invalid.

HTTP Status Code: 400 ResourceNotFoundException

A specified resource cannot be located.

HTTP Status Code: 400 TagLimitExceededException

The limit in the number of tags has been exceeded.

(12)

Examples

HTTP Status Code: 400

Examples

The following is an example of a request and response for the AddTags operation.

This example illustrates one usage of AddTags.

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.AddTags { "ResourceId": "exampleModelId", "ResourceType": "MLModel", "Tags": {

"Key":"exampleKey", "Value":"exampleKeyValue"

}}

Sample Response

HTTP/1.1 200 OK

x-amzn-RequestId: <RequestId>

Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes>

Date: <Date>

{ "ResourceId": "exampleModelId", "ResourceType": "MLModel"

}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

(13)

See Also

• AWS SDK for Python

• AWS SDK for Ruby V3

(14)

CreateBatchPrediction

CreateBatchPrediction

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 (p. 82) 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.

Request Syntax

{ "BatchPredictionDataSourceId": "string", "BatchPredictionId": "string",

"BatchPredictionName": "string", "MLModelId": "string",

"OutputUri": "string"

}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters (p. 159).

The request accepts the following data in JSON format.

BatchPredictionDataSourceId (p. 7)

The ID of the DataSource that points to the group of observations to predict.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes BatchPredictionId (p. 7)

A user-supplied ID that uniquely identifies the BatchPrediction.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes

BatchPredictionName (p. 7)

A user-supplied name or description of the BatchPrediction. BatchPredictionName can only use the UTF-8 character set.

(15)

Response Syntax

Type: String

Length Constraints: Maximum length of 1024.

Pattern: .*\S.*|^$

Required: No MLModelId (p. 7)

The ID of the MLModel that will generate predictions for the group of observations.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes OutputUri (p. 7)

The location of an Amazon Simple Storage Service (Amazon S3) bucket or directory to store the batch prediction results. The following substrings are not allowed in the s3 key portion of the outputURI field: ':', '//', '/./', '/../'.

Amazon ML needs permissions to store and retrieve the logs on your behalf. For information about how to set permissions, see the Amazon Machine Learning Developer Guide.

Type: String

Length Constraints: Maximum length of 2048.

Pattern: s3://([^/]+)(/.*)?

Required: Yes

Response Syntax

{ "BatchPredictionId": "string"

}

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.

BatchPredictionId (p. 8)

A user-supplied ID that uniquely identifies the BatchPrediction. This value is identical to the value of the BatchPredictionId in the request.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

(16)

Errors

Errors

For information about the errors that are common to all actions, see Common Errors (p. 161).

IdempotentParameterMismatchException

A second request to use or change an object was not allowed. This can result from retrying a request using a parameter that was not present in the original request.

HTTP Status Code: 400 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

Examples

The following is a sample request and response of the BatchPrediction operation.

This example illustrates one usage of CreateBatchPrediction.

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.CreateBatchPrediction {

"BatchPredictionId": "EXAMPLE-bp-2014-09-12-15-14-04-156", "BatchPredictionName": "EXAMPLE",

"MLModelId": "EXAMPLE-pr-2014-09-12-15-14-04-924",

"BatchPredictionDataSourceId": "EXAMPLE-tr-ds-2014-09-12-15-14-04-989",

"OutputUri": "s3://eml-test-EXAMPLE/test-outputs/EXAMPLE-bp-2014-09-12-15-14-04-156/

results"

}

Sample Response

HTTP/1.1 200 OK

x-amzn-RequestId: <RequestId>

Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes>

(17)

See Also

Date: <Date>

{"BatchPredictionId":"EXAMPLE-bp-2014-09-12-15-14-04-156"}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(18)

CreateDataSourceFromRDS

CreateDataSourceFromRDS

Creates a DataSource object from an Amazon Relational Database Service (Amazon RDS). A DataSource references data that can be used to perform CreateMLModel, CreateEvaluation, or CreateBatchPrediction operations.

CreateDataSourceFromRDS is an asynchronous operation. In response to

CreateDataSourceFromRDS, Amazon Machine Learning (Amazon ML) immediately returns and sets the DataSource status to PENDING. After the DataSource is created and ready for use, Amazon ML sets the Status parameter to COMPLETED. DataSource in the COMPLETED or PENDING state can be used only to perform >CreateMLModel>, CreateEvaluation, or CreateBatchPrediction operations.

If Amazon ML cannot accept the input source, it sets the Status parameter to FAILED and includes an error message in the Message attribute of the GetDataSource operation response.

Request Syntax

{

"ComputeStatistics": boolean, "DataSourceId": "string", "DataSourceName": "string", "RDSData": {

"DatabaseCredentials": { "Password": "string", "Username": "string"

},

"DatabaseInformation": { "DatabaseName": "string", "InstanceIdentifier": "string"

},

"DataRearrangement": "string", "DataSchema": "string", "DataSchemaUri": "string", "ResourceRole": "string", "S3StagingLocation": "string", "SecurityGroupIds": [ "string" ], "SelectSqlQuery": "string", "ServiceRole": "string", "SubnetId": "string"

},

"RoleARN": "string"

}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters (p. 159).

The request accepts the following data in JSON format.

ComputeStatistics (p. 11)

The compute statistics for a DataSource. The statistics are generated from the observation data referenced by a DataSource. Amazon ML uses the statistics internally during MLModel training.

This parameter must be set to true if the DataSource needs to be used for MLModel training.

Type: Boolean

(19)

Request Parameters

Required: No DataSourceId (p. 11)

A user-supplied ID that uniquely identifies the DataSource. Typically, an Amazon Resource Number (ARN) becomes the ID for a DataSource.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes DataSourceName (p. 11)

A user-supplied name or description of the DataSource.

Type: String

Length Constraints: Maximum length of 1024.

Pattern: .*\S.*|^$

Required: No RDSData (p. 11)

The data specification of an Amazon RDS DataSource:

• DatabaseInformation -

• DatabaseName - The name of the Amazon RDS database.

• InstanceIdentifier - A unique identifier for the Amazon RDS database instance.

• DatabaseCredentials - AWS Identity and Access Management (IAM) credentials that are used to connect to the Amazon RDS database.

• ResourceRole - A role (DataPipelineDefaultResourceRole) assumed by an EC2 instance to carry out the copy task from Amazon RDS to Amazon Simple Storage Service (Amazon S3). For more information, see Role templates for data pipelines.

• ServiceRole - A role (DataPipelineDefaultRole) assumed by the AWS Data Pipeline service to monitor the progress of the copy task from Amazon RDS to Amazon S3. For more information, see Role templates for data pipelines.

• SecurityInfo - The security information to use to access an RDS DB instance. You need to set up appropriate ingress rules for the security entity IDs provided to allow access to the Amazon RDS instance. Specify a [SubnetId, SecurityGroupIds] pair for a VPC-based RDS DB instance.

• SelectSqlQuery - A query that is used to retrieve the observation data for the Datasource.

• S3StagingLocation - The Amazon S3 location for staging Amazon RDS data. The data retrieved from Amazon RDS using SelectSqlQuery is stored in this location.

• DataSchemaUri - The Amazon S3 location of the DataSchema.

• DataSchema - A JSON string representing the schema. This is not required if DataSchemaUri is specified.

• DataRearrangement - A JSON string that represents the splitting and rearrangement requirements for the Datasource.

Sample - "{\"splitting\":{\"percentBegin\":10,\"percentEnd\":60}}"

Type: RDSDataSpec (p. 140) object

(20)

Response Syntax

Required: Yes RoleARN (p. 11)

The role that Amazon ML assumes on behalf of the user to create and activate a data pipeline in the user's account and copy data using the SelectSqlQuery query from Amazon RDS to Amazon S3.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 110.

Required: Yes

Response Syntax

{ "DataSourceId": "string"

}

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.

DataSourceId (p. 13)

A user-supplied ID that uniquely identifies the datasource. This value should be identical to the value of the DataSourceID in the request.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Errors

For information about the errors that are common to all actions, see Common Errors (p. 161).

IdempotentParameterMismatchException

A second request to use or change an object was not allowed. This can result from retrying a request using a parameter that was not present in the original request.

HTTP Status Code: 400 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.

(21)

Examples

HTTP Status Code: 400

Examples

The following is a sample HTTP request and response of the CreateDataSourceFromRDS operation.

This example illustrates one usage of CreateDataSourceFromRDS.

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.CreateDataSourceFromRDS { "DataSourceId": "ml-rds-data-source-demo",

"DataSourceName": "ml-rds-data-source-demo", "RDSData":

{

"DatabaseInformation":

{

"InstanceIdentifier": "demo", "DatabaseName": "demo"

},

"SelectSqlQuery": "select feature1, feature2, feature3, ...., featureN from RDS_DEMO_TABLE;",

"DatabaseCredentials":

{

"Username": "demo_user", "Password": "demo_password"

},

"S3StagingLocation": "s3://mldemo/data/",

"DataSchemaUri": "s3://mldemo/schema/mldemo.csv.schema", "ResourceRole": "DataPipelineDefaultResourceRole", "ServiceRole": "DataPipelineDefaultRole",

"SubnetId": "subnet-XXXX", "SecurityGroupIds":

["sg-XXXXXX", "sg-XXXXXX"]

},

"RoleARN": "arn:aws:iam::<awsAccountId>:role/<roleToAssume>"

}

Sample Response

HTTP/1.1 200 OK

x-amzn-RequestId: <RequestId>

Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes>

Date: <Date>

{ "DataSourceId":"ml-rds-data-source-demo"

(22)

See Also

}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(23)

CreateDataSourceFromRedshift

CreateDataSourceFromRedshift

Creates a DataSource from a database hosted on an Amazon Redshift cluster. A DataSource references data that can be used to perform either CreateMLModel, CreateEvaluation, or CreateBatchPrediction operations.

CreateDataSourceFromRedshift is an asynchronous operation. In response to

CreateDataSourceFromRedshift, Amazon Machine Learning (Amazon ML) immediately returns and sets the DataSource status to PENDING. After the DataSource is created and ready for use, Amazon ML sets the Status parameter to COMPLETED. DataSource in COMPLETED or PENDING states can be used to perform only CreateMLModel, CreateEvaluation, or CreateBatchPrediction operations.

If Amazon ML can't accept the input source, it sets the Status parameter to FAILED and includes an error message in the Message attribute of the GetDataSource operation response.

The observations should be contained in the database hosted on an Amazon Redshift cluster and should be specified by a SelectSqlQuery query. Amazon ML executes an Unload command in Amazon Redshift to transfer the result set of the SelectSqlQuery query to S3StagingLocation.

After the DataSource has been created, it's ready for use in evaluations and batch predictions. If you plan to use the DataSource to train an MLModel, the DataSource also requires a recipe. A recipe describes how each input variable will be used in training an MLModel. Will the variable be included or excluded from training? Will the variable be manipulated; for example, will it be combined with another variable or will it be split apart into word combinations? The recipe provides answers to these questions.

You can't change an existing datasource, but you can copy and modify the settings from an existing Amazon Redshift datasource to create a new datasource. To do so, call GetDataSource for an existing datasource and copy the values to a CreateDataSource call. Change the settings that you want to change and make sure that all required fields have the appropriate values.

Request Syntax

{ "ComputeStatistics": boolean, "DataSourceId": "string", "DataSourceName": "string", "DataSpec": {

"DatabaseCredentials": { "Password": "string", "Username": "string"

},

"DatabaseInformation": {

"ClusterIdentifier": "string", "DatabaseName": "string"

},

"DataRearrangement": "string", "DataSchema": "string", "DataSchemaUri": "string", "S3StagingLocation": "string", "SelectSqlQuery": "string"

},

"RoleARN": "string"

}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters (p. 159).

(24)

Request Parameters

The request accepts the following data in JSON format.

ComputeStatistics (p. 16)

The compute statistics for a DataSource. The statistics are generated from the observation data referenced by a DataSource. Amazon ML uses the statistics internally during MLModel training.

This parameter must be set to true if the DataSource needs to be used for MLModel training.

Type: Boolean Required: No DataSourceId (p. 16)

A user-supplied ID that uniquely identifies the DataSource.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes DataSourceName (p. 16)

A user-supplied name or description of the DataSource.

Type: String

Length Constraints: Maximum length of 1024.

Pattern: .*\S.*|^$

Required: No DataSpec (p. 16)

The data specification of an Amazon Redshift DataSource:

• DatabaseInformation -

• DatabaseName - The name of the Amazon Redshift database.

• ClusterIdentifier - The unique ID for the Amazon Redshift cluster.

• DatabaseCredentials - The AWS Identity and Access Management (IAM) credentials that are used to connect to the Amazon Redshift database.

• SelectSqlQuery - The query that is used to retrieve the observation data for the Datasource.

• S3StagingLocation - The Amazon Simple Storage Service (Amazon S3) location for staging Amazon Redshift data. The data retrieved from Amazon Redshift using the SelectSqlQuery query is stored in this location.

• DataSchemaUri - The Amazon S3 location of the DataSchema.

• DataSchema - A JSON string representing the schema. This is not required if DataSchemaUri is specified.

• DataRearrangement - A JSON string that represents the splitting and rearrangement requirements for the DataSource.

Sample - "{\"splitting\":{\"percentBegin\":10,\"percentEnd\":60}}"

Type: RedshiftDataSpec (p. 150) object Required: Yes

(25)

Response Syntax

RoleARN (p. 16)

A fully specified role Amazon Resource Name (ARN). Amazon ML assumes the role on behalf of the user to create the following:

• A security group to allow Amazon ML to execute the SelectSqlQuery query on an Amazon Redshift cluster

• An Amazon S3 bucket policy to grant Amazon ML read/write permissions on the S3StagingLocation

Type: String

Length Constraints: Minimum length of 1. Maximum length of 110.

Required: Yes

Response Syntax

{ "DataSourceId": "string"

}

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.

DataSourceId (p. 18)

A user-supplied ID that uniquely identifies the datasource. This value should be identical to the value of the DataSourceID in the request.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Errors

For information about the errors that are common to all actions, see Common Errors (p. 161).

IdempotentParameterMismatchException

A second request to use or change an object was not allowed. This can result from retrying a request using a parameter that was not present in the original request.

HTTP Status Code: 400 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.

(26)

Examples

HTTP Status Code: 400

Examples

The following is a sample request and response of the CreateDataSourceFromRedshift operation.

This example illustrates one usage of CreateDataSourceFromRedshift.

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.CreateDataSourceFromRedshift {

"DataSourceId": "ds-exampleDatasourceId", "DataSourceName": "exampleDatasourceName", "DataSpec":

{ "DatabaseInformation":

{

"DatabaseName": "dev",

"ClusterIdentifier": "test-cluster-1234"

},

"SelectSqlQuery": "select * from table", "DatabaseCredentials":

{

"Username": "foo", "Password": "foo"

},

"S3StagingLocation": "s3://bucketName/",

"DataSchemaUri": "s3://bucketName/locationToUri/example.schema.json"}, "RoleARN": "arn:aws:iam::<awsAccountId>:role/username"

}}

Sample Response

HTTP/1.1 200 OK

x-amzn-RequestId: <RequestId>

Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes>

Date: <Date>

{"DataSourceId": "ds-exampleDatasourceId"}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

(27)

See Also

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(28)

CreateDataSourceFromS3

CreateDataSourceFromS3

Creates a DataSource object. A DataSource references data that can be used to perform CreateMLModel, CreateEvaluation, or CreateBatchPrediction operations.

CreateDataSourceFromS3 is an asynchronous operation. In response to CreateDataSourceFromS3, Amazon Machine Learning (Amazon ML) immediately returns and sets the DataSource status to PENDING. After the DataSource has been created and is ready for use, Amazon ML sets the Status parameter to COMPLETED. DataSource in the COMPLETED or PENDING state can be used to perform only CreateMLModel, CreateEvaluation or CreateBatchPrediction operations.

If Amazon ML can't accept the input source, it sets the Status parameter to FAILED and includes an error message in the Message attribute of the GetDataSource operation response.

The observation data used in a DataSource should be ready to use; that is, it should have a consistent structure, and missing data values should be kept to a minimum. The observation data must reside in one or more .csv files in an Amazon Simple Storage Service (Amazon S3) location, along with a schema that describes the data items by name and type. The same schema must be used for all of the data files referenced by the DataSource.

After the DataSource has been created, it's ready to use in evaluations and batch predictions. If you plan to use the DataSource to train an MLModel, the DataSource also needs a recipe. A recipe describes how each input variable will be used in training an MLModel. Will the variable be included or excluded from training? Will the variable be manipulated; for example, will it be combined with another variable or will it be split apart into word combinations? The recipe provides answers to these questions.

Request Syntax

{

"ComputeStatistics": boolean, "DataSourceId": "string", "DataSourceName": "string", "DataSpec": {

"DataLocationS3": "string", "DataRearrangement": "string", "DataSchema": "string",

"DataSchemaLocationS3": "string"

}}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters (p. 159).

The request accepts the following data in JSON format.

ComputeStatistics (p. 21)

The compute statistics for a DataSource. The statistics are generated from the observation data referenced by a DataSource. Amazon ML uses the statistics internally during MLModel training.

This parameter must be set to true if the DataSource needs to be used for MLModel training.

Type: Boolean Required: No

(29)

Response Syntax

DataSourceId (p. 21)

A user-supplied identifier that uniquely identifies the DataSource.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes DataSourceName (p. 21)

A user-supplied name or description of the DataSource.

Type: String

Length Constraints: Maximum length of 1024.

Pattern: .*\S.*|^$

Required: No DataSpec (p. 21)

The data specification of a DataSource:

• DataLocationS3 - The Amazon S3 location of the observation data.

• DataSchemaLocationS3 - The Amazon S3 location of the DataSchema.

• DataSchema - A JSON string representing the schema. This is not required if DataSchemaUri is specified.

• DataRearrangement - A JSON string that represents the splitting and rearrangement requirements for the Datasource.

Sample - "{\"splitting\":{\"percentBegin\":10,\"percentEnd\":60}}"

Type: S3DataSpec (p. 155) object Required: Yes

Response Syntax

{ "DataSourceId": "string"

}

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.

DataSourceId (p. 22)

A user-supplied ID that uniquely identifies the DataSource. This value should be identical to the value of the DataSourceID in the request.

Type: String

(30)

Errors

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Errors

For information about the errors that are common to all actions, see Common Errors (p. 161).

IdempotentParameterMismatchException

A second request to use or change an object was not allowed. This can result from retrying a request using a parameter that was not present in the original request.

HTTP Status Code: 400 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

Examples

The following is a sample request and response of the CreateDataSourceFromS3 operation.

This example illustrates one usage of CreateDataSourceFromS3.

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.CreateDataSourceFromS3 { "DataSourceId": "exampleDataSourceId",

"DataSourceName": "exampleDataSourceName", "DataSpec":

{

"DataLocationS3": "s3://eml-test-EXAMPLE/data.csv",

"DataSchemaLocationS3": "s3://eml-test-EXAMPLE/data.csv.schema",

"DataRearrangement": "{\"splitting\":{\"percentBegin\":10,\"percentEnd\":60}}"

}}

(31)

See Also

Sample Response

HTTP/1.1 200 OK

x-amzn-RequestId: <RequestId>

Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes>

Date: <Date>

{"DataSourceId":"exampleDataSourceId"}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(32)

CreateEvaluation

CreateEvaluation

Creates a new Evaluation of an MLModel. An MLModel is evaluated on a set of observations

associated to a DataSource. Like a DataSource for an MLModel, the DataSource for an Evaluation contains values for the Target Variable. The Evaluation compares the predicted result for

each observation to the actual outcome and provides a summary so that you know how effective the MLModel functions on the test data. Evaluation generates a relevant performance metric, such as BinaryAUC, RegressionRMSE or MulticlassAvgFScore based on the corresponding MLModelType: BINARY, REGRESSION or MULTICLASS.

CreateEvaluation is an asynchronous operation. In response to CreateEvaluation, Amazon Machine Learning (Amazon ML) immediately returns and sets the evaluation status to PENDING. After the Evaluation is created and ready for use, Amazon ML sets the status to COMPLETED.

You can use the GetEvaluation operation to check progress of the evaluation during the creation operation.

Request Syntax

{ "EvaluationDataSourceId": "string", "EvaluationId": "string",

"EvaluationName": "string", "MLModelId": "string"

}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters (p. 159).

The request accepts the following data in JSON format.

EvaluationDataSourceId (p. 25)

The ID of the DataSource for the evaluation. The schema of the DataSource must match the schema used to create the MLModel.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes EvaluationId (p. 25)

A user-supplied ID that uniquely identifies the Evaluation.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes

(33)

Response Syntax

EvaluationName (p. 25)

A user-supplied name or description of the Evaluation.

Type: String

Length Constraints: Maximum length of 1024.

Pattern: .*\S.*|^$

Required: No MLModelId (p. 25)

The ID of the MLModel to evaluate.

The schema used in creating the MLModel must match the schema of the DataSource used in the Evaluation.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes

Response Syntax

{

"EvaluationId": "string"

}

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.

EvaluationId (p. 26)

The user-supplied ID that uniquely identifies the Evaluation. This value should be identical to the value of the EvaluationId in the request.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Errors

For information about the errors that are common to all actions, see Common Errors (p. 161).

IdempotentParameterMismatchException

A second request to use or change an object was not allowed. This can result from retrying a request using a parameter that was not present in the original request.

(34)

Examples

HTTP Status Code: 400 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

Examples

The following is a sample request and response of the CreateEvaluation operation:

This example illustrates one usage of CreateEvaluation.

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.CreateEvaluation

{ "EvaluationId": "CreateEvaluation-pr-2014-09-12-15-14-04-924", "EvaluationName": "EXAMPLE",

"MLModelId": "EXAMPLE-pr-2014-09-12-15-14-04-924",

"EvaluationDataSourceId": "EXAMPLE-ev-ds-2014-09-12-15-14-04-411", }

Sample Response

HTTP/1.1 200 OK

x-amzn-RequestId: <RequestId>

Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes>

Date: <Date>

{"EvaluationId":"CreateEvaluation-pr-2014-09-12-15-14-04-924"}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

(35)

See Also

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(36)

CreateMLModel

CreateMLModel

Creates a new MLModel using the DataSource and the recipe as information sources.

An MLModel is nearly immutable. Users can update only the MLModelName and the ScoreThreshold in an MLModel without creating a new MLModel.

CreateMLModel is an asynchronous operation. In response to CreateMLModel, Amazon Machine Learning (Amazon ML) immediately returns and sets the MLModel status to PENDING. After the MLModel has been created and ready is for use, Amazon ML sets the status to COMPLETED.

You can use the GetMLModel operation to check the progress of the MLModel during the creation operation.

CreateMLModel requires a DataSource with computed statistics, which can be created by setting ComputeStatistics to true in CreateDataSourceFromRDS, CreateDataSourceFromS3, or CreateDataSourceFromRedshift operations.

Request Syntax

{ "MLModelId": "string", "MLModelName": "string", "MLModelType": "string", "Parameters": {

"string" : "string"

},

"Recipe": "string", "RecipeUri": "string",

"TrainingDataSourceId": "string"

}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters (p. 159).

The request accepts the following data in JSON format.

MLModelId (p. 29)

A user-supplied ID that uniquely identifies the MLModel.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes MLModelName (p. 29)

A user-supplied name or description of the MLModel.

Type: String

Length Constraints: Maximum length of 1024.

(37)

Request Parameters

Pattern: .*\S.*|^$

Required: No MLModelType (p. 29)

The category of supervised learning that this MLModel will address. Choose from the following types:

• Choose REGRESSION if the MLModel will be used to predict a numeric value.

• Choose BINARY if the MLModel result has two possible values.

• Choose MULTICLASS if the MLModel result has a limited number of values.

For more information, see the Amazon Machine Learning Developer Guide.

Type: String

Valid Values: REGRESSION | BINARY | MULTICLASS Required: Yes

Parameters (p. 29)

A list of the training parameters in the MLModel. The list is implemented as a map of key-value pairs.

The following is the current set of training parameters:

• sgd.maxMLModelSizeInBytes - The maximum allowed size of the model. Depending on the input data, the size of the model might affect its performance.

The value is an integer that ranges from 100000 to 2147483648. The default value is 33554432.

• sgd.maxPasses - The number of times that the training process traverses the observations to build the MLModel. The value is an integer that ranges from 1 to 100. The default value is 10.

• sgd.shuffleType - Whether Amazon ML shuffles the training data. Shuffling the data improves a model's ability to find the optimal solution for a variety of data types. The valid values are auto and none. The default value is none. We strongly recommend that you shuffle your data.

• sgd.l1RegularizationAmount - The coefficient regularization L1 norm. It controls overfitting the data by penalizing large coefficients. This tends to drive coefficients to zero, resulting in a sparse feature set. If you use this parameter, start by specifying a small value, such as 1.0E-08.

The value is a double that ranges from 0 to MAX_DOUBLE. The default is to not use L1

normalization. This parameter can't be used when L2 is specified. Use this parameter sparingly.

• sgd.l2RegularizationAmount - The coefficient regularization L2 norm. It controls overfitting the data by penalizing large coefficients. This tends to drive coefficients to small, nonzero values.

If you use this parameter, start by specifying a small value, such as 1.0E-08.

The value is a double that ranges from 0 to MAX_DOUBLE. The default is to not use L2

normalization. This parameter can't be used when L1 is specified. Use this parameter sparingly.

Type: String to string map Required: No

Recipe (p. 29)

The data recipe for creating the MLModel. You must specify either the recipe or its URI. If you don't specify a recipe or its URI, Amazon ML creates a default.

Type: String

Length Constraints: Maximum length of 131071.

(38)

Response Syntax

Required: No RecipeUri (p. 29)

The Amazon Simple Storage Service (Amazon S3) location and file name that contains the MLModel recipe. You must specify either the recipe or its URI. If you don't specify a recipe or its URI, Amazon ML creates a default.

Type: String

Length Constraints: Maximum length of 2048.

Pattern: s3://([^/]+)(/.*)?

Required: No

TrainingDataSourceId (p. 29)

The DataSource that points to the training data.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes

Response Syntax

{ "MLModelId": "string"

}

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.

MLModelId (p. 31)

A user-supplied ID that uniquely identifies the MLModel. This value should be identical to the value of the MLModelId in the request.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Errors

For information about the errors that are common to all actions, see Common Errors (p. 161).

IdempotentParameterMismatchException

A second request to use or change an object was not allowed. This can result from retrying a request using a parameter that was not present in the original request.

(39)

Examples

HTTP Status Code: 400 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

Examples

The following is a sample request and response of the CreateMLModel operation.

This example illustrates one usage of CreateMLModel.

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.CreateMLModel {

"MLModelId": "exampleModelId", "MLModelName": "EXAMPLE", "MLModelType": "BINARY",

"TrainingDataSourceId": "17SdAv6WC6r5vACAxF7U", "RecipeUri": "s3://eml-test-EXAMPLE/data.recipe.json"

}

Sample Response

HTTP/1.1 200 OK

x-amzn-RequestId: <RequestId>

Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes>

Date: <Date>

{"MLModelId":"exampleModelId"}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

(40)

See Also

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(41)

CreateRealtimeEndpoint

CreateRealtimeEndpoint

Creates a real-time endpoint for the MLModel. The endpoint contains the URI of the MLModel; that is, the location to send real-time prediction requests for the specified MLModel.

Request Syntax

{

"MLModelId": "string"

}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters (p. 159).

The request accepts the following data in JSON format.

MLModelId (p. 34)

The ID assigned to the MLModel during creation.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes

Response Syntax

{ "MLModelId": "string", "RealtimeEndpointInfo": { "CreatedAt": number, "EndpointStatus": "string", "EndpointUrl": "string",

"PeakRequestsPerSecond": 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.

MLModelId (p. 34)

A user-supplied ID that uniquely identifies the MLModel. This value should be identical to the value of the MLModelId in the request.

Type: String

(42)

Errors

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

RealtimeEndpointInfo (p. 34)

The endpoint information of the MLModel Type: RealtimeEndpointInfo (p. 146) object

Errors

For information about the errors that are common to all actions, see Common Errors (p. 161).

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 CreateRealtimeEndpoint operation.

This example illustrates one usage of CreateRealtimeEndpoint.

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.CreateRealtimeEndpoint { "MLModelId": "ml-ModelExampleId",

}

Sample Response

HTTP/1.1 200 OK

(43)

See Also

x-amzn-RequestId: <RequestId>

Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes>

Date: <Date>

{ "MLModelId": "ml-ModelExampleId", "EndpointInfo":

{ "CreatedAt": 1422488124.71,

"EndpointUrl": "<realtime endpoint from Amazon Machine Learning for ml- ModelExampleId>",

"EndpointStatus": "READY", "PeakRequestsPerSecond": 200 }

}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(44)

DeleteBatchPrediction

DeleteBatchPrediction

Assigns the DELETED status to a BatchPrediction, rendering it unusable.

After using the DeleteBatchPrediction operation, you can use the GetBatchPrediction (p. 82) operation to verify that the status of the BatchPrediction changed to DELETED.

Caution: The result of the DeleteBatchPrediction operation is irreversible.

Request Syntax

{

"BatchPredictionId": "string"

}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters (p. 159).

The request accepts the following data in JSON format.

BatchPredictionId (p. 37)

A user-supplied ID that uniquely identifies the BatchPrediction.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes

Response Syntax

{ "BatchPredictionId": "string"

}

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.

BatchPredictionId (p. 37)

A user-supplied ID that uniquely identifies the BatchPrediction. This value should be identical to the value of the BatchPredictionID in the request.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

(45)

Errors

Errors

For information about the errors that are common to all actions, see Common Errors (p. 161).

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 DeleteBatchPrediction operation.

This example illustrates one usage of DeleteBatchPrediction.

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.DeleteBatchPrediction {"BatchPredictionId": "exampleBatchPredictionId"}

Sample Response

HTTP/1.1 200 OK

x-amzn-RequestId: <RequestId>

Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes>

Date: <Date>

{"BatchPredictionId":"exampleBatchPredictionId"}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

(46)

See Also

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(47)

DeleteDataSource

DeleteDataSource

Assigns the DELETED status to a DataSource, rendering it unusable.

After using the DeleteDataSource operation, you can use the GetDataSource (p. 87) operation to verify that the status of the DataSource changed to DELETED.

Caution: The results of the DeleteDataSource operation are irreversible.

Request Syntax

{

"DataSourceId": "string"

}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters (p. 159).

The request accepts the following data in JSON format.

DataSourceId (p. 40)

A user-supplied ID that uniquely identifies the DataSource.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes

Response Syntax

{ "DataSourceId": "string"

}

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.

DataSourceId (p. 40)

A user-supplied ID that uniquely identifies the DataSource. This value should be identical to the value of the DataSourceID in the request.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

(48)

Errors

Errors

For information about the errors that are common to all actions, see Common Errors (p. 161).

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 DeleteDataSource operation:

This example illustrates one usage of DeleteDataSource.

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.DeleteDataSource {"DataSourceId": "exampleDataSourceId"}

Sample Response

HTTP/1.1 200 OK

x-amzn-RequestId: <RequestId>

Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes>

Date: <Date>

{"DataSourceId":"exampleDataSourceId"}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

(49)

See Also

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(50)

DeleteEvaluation

DeleteEvaluation

Assigns the DELETED status to an Evaluation, rendering it unusable.

After invoking the DeleteEvaluation operation, you can use the GetEvaluation operation to verify that the status of the Evaluation changed to DELETED.

Caution: The results of the DeleteEvaluation operation are irreversible.

Request Syntax

{

"EvaluationId": "string"

}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters (p. 159).

The request accepts the following data in JSON format.

EvaluationId (p. 43)

A user-supplied ID that uniquely identifies the Evaluation to delete.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes

Response Syntax

{ "EvaluationId": "string"

}

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.

EvaluationId (p. 43)

A user-supplied ID that uniquely identifies the Evaluation. This value should be identical to the value of the EvaluationId in the request.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_.-]+

參考文獻

相關文件

Upon reception of a valid write command (CMD24 or CMD25 in the SD Memory Card protocol), the card will respond with a response token and will wait for a data block to be sent from

• The memory storage unit is where instructions and data are held while a computer program is running.. • A bus is a group of parallel wires that transfer data from one part of

In JSDZ, a model process in the modeling phase is treated as an active entity that requires an operation on its data store to add a new instance to the collection of

• The memory storage unit holds instructions and data for a running program.. • A bus is a group of wires that transfer data from one part to another (data,

An additional senior teacher post, to be offset by a post in the rank of APSM, is provided to each primary special school/special school with primary section that operates six or

An additional senior teacher post, to be offset by a post in the rank of APSM, is provided to each primary special school/special school with primary section that operates six or

● In computer science, a data structure is a data organization, management, and storage format that enables efficient access and

Following the supply by the school of a copy of personal data in compliance with a data access request, the requestor is entitled to ask for correction of the personal data