Table of Contents
MachineLearning.Client¶A low-level client representing Amazon Machine Learning:
client = session.create_client('machinelearning')
These are the available methods:
add_tags()can_paginate()create_batch_prediction()create_data_source_from_rds()create_data_source_from_redshift()create_data_source_from_s3()create_evaluation()create_ml_model()create_realtime_endpoint()delete_batch_prediction()delete_data_source()delete_evaluation()delete_ml_model()delete_realtime_endpoint()delete_tags()describe_batch_predictions()describe_data_sources()describe_evaluations()describe_ml_models()describe_tags()generate_presigned_url()get_batch_prediction()get_data_source()get_evaluation()get_ml_model()get_paginator()get_waiter()predict()update_batch_prediction()update_data_source()update_evaluation()update_ml_model()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.
See also: AWS API Documentation
Request Syntax
response = client.add_tags(
Tags=[
{
'Key': 'string',
'Value': 'string'
},
],
ResourceId='string',
ResourceType='BatchPrediction'|'DataSource'|'Evaluation'|'MLModel'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ResourceId': 'string',
'ResourceType': 'BatchPrediction'|'DataSource'|'Evaluation'|'MLModel'
}
Response Structure
|
can_paginate(operation_name)¶Check if an operation can be paginated.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Returns: | True if the operation can be paginated,
False otherwise. |
create_batch_prediction(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_batch_prediction(
BatchPredictionId='string',
BatchPredictionName='string',
MLModelId='string',
BatchPredictionDataSourceId='string',
OutputUri='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'BatchPredictionId': 'string'
}
Response Structure
|
create_data_source_from_rds(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_data_source_from_rds(
DataSourceId='string',
DataSourceName='string',
RDSData={
'DatabaseInformation': {
'InstanceIdentifier': 'string',
'DatabaseName': 'string'
},
'SelectSqlQuery': 'string',
'DatabaseCredentials': {
'Username': 'string',
'Password': 'string'
},
'S3StagingLocation': 'string',
'DataRearrangement': 'string',
'DataSchema': 'string',
'DataSchemaUri': 'string',
'ResourceRole': 'string',
'ServiceRole': 'string',
'SubnetId': 'string',
'SecurityGroupIds': [
'string',
]
},
RoleARN='string',
ComputeStatistics=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'DataSourceId': 'string'
}
Response Structure
|
create_data_source_from_redshift(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_data_source_from_redshift(
DataSourceId='string',
DataSourceName='string',
DataSpec={
'DatabaseInformation': {
'DatabaseName': 'string',
'ClusterIdentifier': 'string'
},
'SelectSqlQuery': 'string',
'DatabaseCredentials': {
'Username': 'string',
'Password': 'string'
},
'S3StagingLocation': 'string',
'DataRearrangement': 'string',
'DataSchema': 'string',
'DataSchemaUri': 'string'
},
RoleARN='string',
ComputeStatistics=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'DataSourceId': 'string'
}
Response Structure
|
create_data_source_from_s3(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_data_source_from_s3(
DataSourceId='string',
DataSourceName='string',
DataSpec={
'DataLocationS3': 'string',
'DataRearrangement': 'string',
'DataSchema': 'string',
'DataSchemaLocationS3': 'string'
},
ComputeStatistics=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'DataSourceId': 'string'
}
Response Structure
|
create_evaluation(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_evaluation(
EvaluationId='string',
EvaluationName='string',
MLModelId='string',
EvaluationDataSourceId='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'EvaluationId': 'string'
}
Response Structure
|
create_ml_model(**kwargs)¶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.
CreateMLModelrequires aDataSourcewith computed statistics, which can be created by settingComputeStatisticstotrueinCreateDataSourceFromRDS,CreateDataSourceFromS3, orCreateDataSourceFromRedshiftoperations.
See also: AWS API Documentation
Request Syntax
response = client.create_ml_model(
MLModelId='string',
MLModelName='string',
MLModelType='REGRESSION'|'BINARY'|'MULTICLASS',
Parameters={
'string': 'string'
},
TrainingDataSourceId='string',
Recipe='string',
RecipeUri='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'MLModelId': 'string'
}
Response Structure
|
create_realtime_endpoint(**kwargs)¶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 .
See also: AWS API Documentation
Request Syntax
response = client.create_realtime_endpoint(
MLModelId='string'
)
| Parameters: | MLModelId (string) – [REQUIRED] The ID assigned to the |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'MLModelId': 'string',
'RealtimeEndpointInfo': {
'PeakRequestsPerSecond': 123,
'CreatedAt': datetime(2015, 1, 1),
'EndpointUrl': 'string',
'EndpointStatus': 'NONE'|'READY'|'UPDATING'|'FAILED'
}
}
Response Structure
|
delete_batch_prediction(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.delete_batch_prediction(
BatchPredictionId='string'
)
| Parameters: | BatchPredictionId (string) – [REQUIRED] A user-supplied ID that uniquely identifies the |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'BatchPredictionId': 'string'
}
Response Structure
|
delete_data_source(**kwargs)¶Assigns the DELETED status to a DataSource , rendering it unusable.
After using the DeleteDataSource operation, you can use the GetDataSource operation to verify that the status of the DataSource changed to DELETED.
Caution: The results of the DeleteDataSource operation are irreversible.
See also: AWS API Documentation
Request Syntax
response = client.delete_data_source(
DataSourceId='string'
)
| Parameters: | DataSourceId (string) – [REQUIRED] A user-supplied ID that uniquely identifies the |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'DataSourceId': 'string'
}
Response Structure
|
delete_evaluation(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.delete_evaluation(
EvaluationId='string'
)
| Parameters: | EvaluationId (string) – [REQUIRED] A user-supplied ID that uniquely identifies the |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'EvaluationId': 'string'
}
Response Structure
|
delete_ml_model(**kwargs)¶Assigns the DELETED status to an MLModel , rendering it unusable.
After using the DeleteMLModel operation, you can use the GetMLModel operation to verify that the status of the MLModel changed to DELETED.
Caution: The result of the DeleteMLModel operation is irreversible.
See also: AWS API Documentation
Request Syntax
response = client.delete_ml_model(
MLModelId='string'
)
| Parameters: | MLModelId (string) – [REQUIRED] A user-supplied ID that uniquely identifies the |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'MLModelId': 'string'
}
Response Structure
|
delete_realtime_endpoint(**kwargs)¶Deletes a real time endpoint of an MLModel .
See also: AWS API Documentation
Request Syntax
response = client.delete_realtime_endpoint(
MLModelId='string'
)
| Parameters: | MLModelId (string) – [REQUIRED] The ID assigned to the |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'MLModelId': 'string',
'RealtimeEndpointInfo': {
'PeakRequestsPerSecond': 123,
'CreatedAt': datetime(2015, 1, 1),
'EndpointUrl': 'string',
'EndpointStatus': 'NONE'|'READY'|'UPDATING'|'FAILED'
}
}
Response Structure
|
Deletes the specified tags associated with an ML object. After this operation is complete, you can’t recover deleted tags.
If you specify a tag that doesn’t exist, Amazon ML ignores it.
See also: AWS API Documentation
Request Syntax
response = client.delete_tags(
TagKeys=[
'string',
],
ResourceId='string',
ResourceType='BatchPrediction'|'DataSource'|'Evaluation'|'MLModel'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ResourceId': 'string',
'ResourceType': 'BatchPrediction'|'DataSource'|'Evaluation'|'MLModel'
}
Response Structure
|
describe_batch_predictions(**kwargs)¶Returns a list of BatchPrediction operations that match the search criteria in the request.
See also: AWS API Documentation
Request Syntax
response = client.describe_batch_predictions(
FilterVariable='CreatedAt'|'LastUpdatedAt'|'Status'|'Name'|'IAMUser'|'MLModelId'|'DataSourceId'|'DataURI',
EQ='string',
GT='string',
LT='string',
GE='string',
LE='string',
NE='string',
Prefix='string',
SortOrder='asc'|'dsc',
NextToken='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Results': [
{
'BatchPredictionId': 'string',
'MLModelId': 'string',
'BatchPredictionDataSourceId': 'string',
'InputDataLocationS3': 'string',
'CreatedByIamUser': 'string',
'CreatedAt': datetime(2015, 1, 1),
'LastUpdatedAt': datetime(2015, 1, 1),
'Name': 'string',
'Status': 'PENDING'|'INPROGRESS'|'FAILED'|'COMPLETED'|'DELETED',
'OutputUri': 'string',
'Message': 'string',
'ComputeTime': 123,
'FinishedAt': datetime(2015, 1, 1),
'StartedAt': datetime(2015, 1, 1),
'TotalRecordCount': 123,
'InvalidRecordCount': 123
},
],
'NextToken': 'string'
}
Response Structure
|
describe_data_sources(**kwargs)¶Returns a list of DataSource that match the search criteria in the request.
See also: AWS API Documentation
Request Syntax
response = client.describe_data_sources(
FilterVariable='CreatedAt'|'LastUpdatedAt'|'Status'|'Name'|'DataLocationS3'|'IAMUser',
EQ='string',
GT='string',
LT='string',
GE='string',
LE='string',
NE='string',
Prefix='string',
SortOrder='asc'|'dsc',
NextToken='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Results': [
{
'DataSourceId': 'string',
'DataLocationS3': 'string',
'DataRearrangement': 'string',
'CreatedByIamUser': 'string',
'CreatedAt': datetime(2015, 1, 1),
'LastUpdatedAt': datetime(2015, 1, 1),
'DataSizeInBytes': 123,
'NumberOfFiles': 123,
'Name': 'string',
'Status': 'PENDING'|'INPROGRESS'|'FAILED'|'COMPLETED'|'DELETED',
'Message': 'string',
'RedshiftMetadata': {
'RedshiftDatabase': {
'DatabaseName': 'string',
'ClusterIdentifier': 'string'
},
'DatabaseUserName': 'string',
'SelectSqlQuery': 'string'
},
'RDSMetadata': {
'Database': {
'InstanceIdentifier': 'string',
'DatabaseName': 'string'
},
'DatabaseUserName': 'string',
'SelectSqlQuery': 'string',
'ResourceRole': 'string',
'ServiceRole': 'string',
'DataPipelineId': 'string'
},
'RoleARN': 'string',
'ComputeStatistics': True|False,
'ComputeTime': 123,
'FinishedAt': datetime(2015, 1, 1),
'StartedAt': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
|
describe_evaluations(**kwargs)¶Returns a list of DescribeEvaluations that match the search criteria in the request.
See also: AWS API Documentation
Request Syntax
response = client.describe_evaluations(
FilterVariable='CreatedAt'|'LastUpdatedAt'|'Status'|'Name'|'IAMUser'|'MLModelId'|'DataSourceId'|'DataURI',
EQ='string',
GT='string',
LT='string',
GE='string',
LE='string',
NE='string',
Prefix='string',
SortOrder='asc'|'dsc',
NextToken='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Results': [
{
'EvaluationId': 'string',
'MLModelId': 'string',
'EvaluationDataSourceId': 'string',
'InputDataLocationS3': 'string',
'CreatedByIamUser': 'string',
'CreatedAt': datetime(2015, 1, 1),
'LastUpdatedAt': datetime(2015, 1, 1),
'Name': 'string',
'Status': 'PENDING'|'INPROGRESS'|'FAILED'|'COMPLETED'|'DELETED',
'PerformanceMetrics': {
'Properties': {
'string': 'string'
}
},
'Message': 'string',
'ComputeTime': 123,
'FinishedAt': datetime(2015, 1, 1),
'StartedAt': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
|
describe_ml_models(**kwargs)¶Returns a list of MLModel that match the search criteria in the request.
See also: AWS API Documentation
Request Syntax
response = client.describe_ml_models(
FilterVariable='CreatedAt'|'LastUpdatedAt'|'Status'|'Name'|'IAMUser'|'TrainingDataSourceId'|'RealtimeEndpointStatus'|'MLModelType'|'Algorithm'|'TrainingDataURI',
EQ='string',
GT='string',
LT='string',
GE='string',
LE='string',
NE='string',
Prefix='string',
SortOrder='asc'|'dsc',
NextToken='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Results': [
{
'MLModelId': 'string',
'TrainingDataSourceId': 'string',
'CreatedByIamUser': 'string',
'CreatedAt': datetime(2015, 1, 1),
'LastUpdatedAt': datetime(2015, 1, 1),
'Name': 'string',
'Status': 'PENDING'|'INPROGRESS'|'FAILED'|'COMPLETED'|'DELETED',
'SizeInBytes': 123,
'EndpointInfo': {
'PeakRequestsPerSecond': 123,
'CreatedAt': datetime(2015, 1, 1),
'EndpointUrl': 'string',
'EndpointStatus': 'NONE'|'READY'|'UPDATING'|'FAILED'
},
'TrainingParameters': {
'string': 'string'
},
'InputDataLocationS3': 'string',
'Algorithm': 'sgd',
'MLModelType': 'REGRESSION'|'BINARY'|'MULTICLASS',
'ScoreThreshold': ...,
'ScoreThresholdLastUpdatedAt': datetime(2015, 1, 1),
'Message': 'string',
'ComputeTime': 123,
'FinishedAt': datetime(2015, 1, 1),
'StartedAt': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
|
Describes one or more of the tags for your Amazon ML object.
See also: AWS API Documentation
Request Syntax
response = client.describe_tags(
ResourceId='string',
ResourceType='BatchPrediction'|'DataSource'|'Evaluation'|'MLModel'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ResourceId': 'string',
'ResourceType': 'BatchPrediction'|'DataSource'|'Evaluation'|'MLModel',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
Response Structure
|
generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
| Parameters: |
|
|---|---|
| Returns: | The presigned url |
get_batch_prediction(**kwargs)¶Returns a BatchPrediction that includes detailed metadata, status, and data file information for a Batch Prediction request.
See also: AWS API Documentation
Request Syntax
response = client.get_batch_prediction(
BatchPredictionId='string'
)
| Parameters: | BatchPredictionId (string) – [REQUIRED] An ID assigned to the |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'BatchPredictionId': 'string',
'MLModelId': 'string',
'BatchPredictionDataSourceId': 'string',
'InputDataLocationS3': 'string',
'CreatedByIamUser': 'string',
'CreatedAt': datetime(2015, 1, 1),
'LastUpdatedAt': datetime(2015, 1, 1),
'Name': 'string',
'Status': 'PENDING'|'INPROGRESS'|'FAILED'|'COMPLETED'|'DELETED',
'OutputUri': 'string',
'LogUri': 'string',
'Message': 'string',
'ComputeTime': 123,
'FinishedAt': datetime(2015, 1, 1),
'StartedAt': datetime(2015, 1, 1),
'TotalRecordCount': 123,
'InvalidRecordCount': 123
}
Response Structure
|
get_data_source(**kwargs)¶Returns a DataSource that includes metadata and data file information, as well as the current status of the DataSource .
GetDataSource provides results in normal or verbose format. The verbose format adds the schema description and the list of files pointed to by the DataSource to the normal format.
See also: AWS API Documentation
Request Syntax
response = client.get_data_source(
DataSourceId='string',
Verbose=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'DataSourceId': 'string',
'DataLocationS3': 'string',
'DataRearrangement': 'string',
'CreatedByIamUser': 'string',
'CreatedAt': datetime(2015, 1, 1),
'LastUpdatedAt': datetime(2015, 1, 1),
'DataSizeInBytes': 123,
'NumberOfFiles': 123,
'Name': 'string',
'Status': 'PENDING'|'INPROGRESS'|'FAILED'|'COMPLETED'|'DELETED',
'LogUri': 'string',
'Message': 'string',
'RedshiftMetadata': {
'RedshiftDatabase': {
'DatabaseName': 'string',
'ClusterIdentifier': 'string'
},
'DatabaseUserName': 'string',
'SelectSqlQuery': 'string'
},
'RDSMetadata': {
'Database': {
'InstanceIdentifier': 'string',
'DatabaseName': 'string'
},
'DatabaseUserName': 'string',
'SelectSqlQuery': 'string',
'ResourceRole': 'string',
'ServiceRole': 'string',
'DataPipelineId': 'string'
},
'RoleARN': 'string',
'ComputeStatistics': True|False,
'ComputeTime': 123,
'FinishedAt': datetime(2015, 1, 1),
'StartedAt': datetime(2015, 1, 1),
'DataSourceSchema': 'string'
}
Response Structure
|
get_evaluation(**kwargs)¶Returns an Evaluation that includes metadata as well as the current status of the Evaluation .
See also: AWS API Documentation
Request Syntax
response = client.get_evaluation(
EvaluationId='string'
)
| Parameters: | EvaluationId (string) – [REQUIRED] The ID of the |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'EvaluationId': 'string',
'MLModelId': 'string',
'EvaluationDataSourceId': 'string',
'InputDataLocationS3': 'string',
'CreatedByIamUser': 'string',
'CreatedAt': datetime(2015, 1, 1),
'LastUpdatedAt': datetime(2015, 1, 1),
'Name': 'string',
'Status': 'PENDING'|'INPROGRESS'|'FAILED'|'COMPLETED'|'DELETED',
'PerformanceMetrics': {
'Properties': {
'string': 'string'
}
},
'LogUri': 'string',
'Message': 'string',
'ComputeTime': 123,
'FinishedAt': datetime(2015, 1, 1),
'StartedAt': datetime(2015, 1, 1)
}
Response Structure
|
get_ml_model(**kwargs)¶Returns an MLModel that includes detailed metadata, data source information, and the current status of the MLModel .
GetMLModel provides results in normal or verbose format.
See also: AWS API Documentation
Request Syntax
response = client.get_ml_model(
MLModelId='string',
Verbose=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'MLModelId': 'string',
'TrainingDataSourceId': 'string',
'CreatedByIamUser': 'string',
'CreatedAt': datetime(2015, 1, 1),
'LastUpdatedAt': datetime(2015, 1, 1),
'Name': 'string',
'Status': 'PENDING'|'INPROGRESS'|'FAILED'|'COMPLETED'|'DELETED',
'SizeInBytes': 123,
'EndpointInfo': {
'PeakRequestsPerSecond': 123,
'CreatedAt': datetime(2015, 1, 1),
'EndpointUrl': 'string',
'EndpointStatus': 'NONE'|'READY'|'UPDATING'|'FAILED'
},
'TrainingParameters': {
'string': 'string'
},
'InputDataLocationS3': 'string',
'MLModelType': 'REGRESSION'|'BINARY'|'MULTICLASS',
'ScoreThreshold': ...,
'ScoreThresholdLastUpdatedAt': datetime(2015, 1, 1),
'LogUri': 'string',
'Message': 'string',
'ComputeTime': 123,
'FinishedAt': datetime(2015, 1, 1),
'StartedAt': datetime(2015, 1, 1),
'Recipe': 'string',
'Schema': 'string'
}
Response Structure
|
get_paginator(operation_name)¶Create a paginator for an operation.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Raises: | OperationNotPageableError – Raised if the operation is not
pageable. You can use the client.can_paginate method to
check if an operation is pageable. |
| Return type: | L{botocore.paginate.Paginator} |
| Returns: | A paginator object. |
get_waiter(waiter_name)¶predict(**kwargs)¶Generates a prediction for the observation using the specified ML Model .
Note
Note
Not all response parameters will be populated. Whether a response parameter is populated depends on the type of model requested.
See also: AWS API Documentation
Request Syntax
response = client.predict(
MLModelId='string',
Record={
'string': 'string'
},
PredictEndpoint='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Prediction': {
'predictedLabel': 'string',
'predictedValue': ...,
'predictedScores': {
'string': ...
},
'details': {
'string': 'string'
}
}
}
Response Structure
|
update_batch_prediction(**kwargs)¶Updates the BatchPredictionName of a BatchPrediction .
You can use the GetBatchPrediction operation to view the contents of the updated data element.
See also: AWS API Documentation
Request Syntax
response = client.update_batch_prediction(
BatchPredictionId='string',
BatchPredictionName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'BatchPredictionId': 'string'
}
Response Structure
|
update_data_source(**kwargs)¶Updates the DataSourceName of a DataSource .
You can use the GetDataSource operation to view the contents of the updated data element.
See also: AWS API Documentation
Request Syntax
response = client.update_data_source(
DataSourceId='string',
DataSourceName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'DataSourceId': 'string'
}
Response Structure
|
update_evaluation(**kwargs)¶Updates the EvaluationName of an Evaluation .
You can use the GetEvaluation operation to view the contents of the updated data element.
See also: AWS API Documentation
Request Syntax
response = client.update_evaluation(
EvaluationId='string',
EvaluationName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'EvaluationId': 'string'
}
Response Structure
|
update_ml_model(**kwargs)¶Updates the MLModelName and the ScoreThreshold of an MLModel .
You can use the GetMLModel operation to view the contents of the updated data element.
See also: AWS API Documentation
Request Syntax
response = client.update_ml_model(
MLModelId='string',
MLModelName='string',
ScoreThreshold=...
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'MLModelId': 'string'
}
Response Structure
|
The available paginators are:
MachineLearning.Paginator.DescribeBatchPredictionsMachineLearning.Paginator.DescribeDataSourcesMachineLearning.Paginator.DescribeEvaluationsMachineLearning.Paginator.DescribeMLModelsMachineLearning.Paginator.DescribeBatchPredictions¶paginator = client.get_paginator('describe_batch_predictions')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from MachineLearning.Client.describe_batch_predictions().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
FilterVariable='CreatedAt'|'LastUpdatedAt'|'Status'|'Name'|'IAMUser'|'MLModelId'|'DataSourceId'|'DataURI',
EQ='string',
GT='string',
LT='string',
GE='string',
LE='string',
NE='string',
Prefix='string',
SortOrder='asc'|'dsc',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Results': [
{
'BatchPredictionId': 'string',
'MLModelId': 'string',
'BatchPredictionDataSourceId': 'string',
'InputDataLocationS3': 'string',
'CreatedByIamUser': 'string',
'CreatedAt': datetime(2015, 1, 1),
'LastUpdatedAt': datetime(2015, 1, 1),
'Name': 'string',
'Status': 'PENDING'|'INPROGRESS'|'FAILED'|'COMPLETED'|'DELETED',
'OutputUri': 'string',
'Message': 'string',
'ComputeTime': 123,
'FinishedAt': datetime(2015, 1, 1),
'StartedAt': datetime(2015, 1, 1),
'TotalRecordCount': 123,
'InvalidRecordCount': 123
},
],
}
Response Structure
|
MachineLearning.Paginator.DescribeDataSources¶paginator = client.get_paginator('describe_data_sources')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from MachineLearning.Client.describe_data_sources().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
FilterVariable='CreatedAt'|'LastUpdatedAt'|'Status'|'Name'|'DataLocationS3'|'IAMUser',
EQ='string',
GT='string',
LT='string',
GE='string',
LE='string',
NE='string',
Prefix='string',
SortOrder='asc'|'dsc',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Results': [
{
'DataSourceId': 'string',
'DataLocationS3': 'string',
'DataRearrangement': 'string',
'CreatedByIamUser': 'string',
'CreatedAt': datetime(2015, 1, 1),
'LastUpdatedAt': datetime(2015, 1, 1),
'DataSizeInBytes': 123,
'NumberOfFiles': 123,
'Name': 'string',
'Status': 'PENDING'|'INPROGRESS'|'FAILED'|'COMPLETED'|'DELETED',
'Message': 'string',
'RedshiftMetadata': {
'RedshiftDatabase': {
'DatabaseName': 'string',
'ClusterIdentifier': 'string'
},
'DatabaseUserName': 'string',
'SelectSqlQuery': 'string'
},
'RDSMetadata': {
'Database': {
'InstanceIdentifier': 'string',
'DatabaseName': 'string'
},
'DatabaseUserName': 'string',
'SelectSqlQuery': 'string',
'ResourceRole': 'string',
'ServiceRole': 'string',
'DataPipelineId': 'string'
},
'RoleARN': 'string',
'ComputeStatistics': True|False,
'ComputeTime': 123,
'FinishedAt': datetime(2015, 1, 1),
'StartedAt': datetime(2015, 1, 1)
},
],
}
Response Structure
|
MachineLearning.Paginator.DescribeEvaluations¶paginator = client.get_paginator('describe_evaluations')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from MachineLearning.Client.describe_evaluations().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
FilterVariable='CreatedAt'|'LastUpdatedAt'|'Status'|'Name'|'IAMUser'|'MLModelId'|'DataSourceId'|'DataURI',
EQ='string',
GT='string',
LT='string',
GE='string',
LE='string',
NE='string',
Prefix='string',
SortOrder='asc'|'dsc',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Results': [
{
'EvaluationId': 'string',
'MLModelId': 'string',
'EvaluationDataSourceId': 'string',
'InputDataLocationS3': 'string',
'CreatedByIamUser': 'string',
'CreatedAt': datetime(2015, 1, 1),
'LastUpdatedAt': datetime(2015, 1, 1),
'Name': 'string',
'Status': 'PENDING'|'INPROGRESS'|'FAILED'|'COMPLETED'|'DELETED',
'PerformanceMetrics': {
'Properties': {
'string': 'string'
}
},
'Message': 'string',
'ComputeTime': 123,
'FinishedAt': datetime(2015, 1, 1),
'StartedAt': datetime(2015, 1, 1)
},
],
}
Response Structure
|
MachineLearning.Paginator.DescribeMLModels¶paginator = client.get_paginator('describe_ml_models')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from MachineLearning.Client.describe_ml_models().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
FilterVariable='CreatedAt'|'LastUpdatedAt'|'Status'|'Name'|'IAMUser'|'TrainingDataSourceId'|'RealtimeEndpointStatus'|'MLModelType'|'Algorithm'|'TrainingDataURI',
EQ='string',
GT='string',
LT='string',
GE='string',
LE='string',
NE='string',
Prefix='string',
SortOrder='asc'|'dsc',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Results': [
{
'MLModelId': 'string',
'TrainingDataSourceId': 'string',
'CreatedByIamUser': 'string',
'CreatedAt': datetime(2015, 1, 1),
'LastUpdatedAt': datetime(2015, 1, 1),
'Name': 'string',
'Status': 'PENDING'|'INPROGRESS'|'FAILED'|'COMPLETED'|'DELETED',
'SizeInBytes': 123,
'EndpointInfo': {
'PeakRequestsPerSecond': 123,
'CreatedAt': datetime(2015, 1, 1),
'EndpointUrl': 'string',
'EndpointStatus': 'NONE'|'READY'|'UPDATING'|'FAILED'
},
'TrainingParameters': {
'string': 'string'
},
'InputDataLocationS3': 'string',
'Algorithm': 'sgd',
'MLModelType': 'REGRESSION'|'BINARY'|'MULTICLASS',
'ScoreThreshold': ...,
'ScoreThresholdLastUpdatedAt': datetime(2015, 1, 1),
'Message': 'string',
'ComputeTime': 123,
'FinishedAt': datetime(2015, 1, 1),
'StartedAt': datetime(2015, 1, 1)
},
],
}
Response Structure
|
The available waiters are:
MachineLearning.Waiter.BatchPredictionAvailableMachineLearning.Waiter.DataSourceAvailableMachineLearning.Waiter.EvaluationAvailableMachineLearning.Waiter.MLModelAvailableMachineLearning.Waiter.BatchPredictionAvailable¶waiter = client.get_waiter('batch_prediction_available')
wait(**kwargs)¶Polls MachineLearning.Client.describe_batch_predictions() every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
FilterVariable='CreatedAt'|'LastUpdatedAt'|'Status'|'Name'|'IAMUser'|'MLModelId'|'DataSourceId'|'DataURI',
EQ='string',
GT='string',
LT='string',
GE='string',
LE='string',
NE='string',
Prefix='string',
SortOrder='asc'|'dsc',
NextToken='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Returns: | None |
MachineLearning.Waiter.DataSourceAvailable¶waiter = client.get_waiter('data_source_available')
wait(**kwargs)¶Polls MachineLearning.Client.describe_data_sources() every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
FilterVariable='CreatedAt'|'LastUpdatedAt'|'Status'|'Name'|'DataLocationS3'|'IAMUser',
EQ='string',
GT='string',
LT='string',
GE='string',
LE='string',
NE='string',
Prefix='string',
SortOrder='asc'|'dsc',
NextToken='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Returns: | None |
MachineLearning.Waiter.EvaluationAvailable¶waiter = client.get_waiter('evaluation_available')
wait(**kwargs)¶Polls MachineLearning.Client.describe_evaluations() every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
FilterVariable='CreatedAt'|'LastUpdatedAt'|'Status'|'Name'|'IAMUser'|'MLModelId'|'DataSourceId'|'DataURI',
EQ='string',
GT='string',
LT='string',
GE='string',
LE='string',
NE='string',
Prefix='string',
SortOrder='asc'|'dsc',
NextToken='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Returns: | None |
MachineLearning.Waiter.MLModelAvailable¶waiter = client.get_waiter('ml_model_available')
wait(**kwargs)¶Polls MachineLearning.Client.describe_ml_models() every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
FilterVariable='CreatedAt'|'LastUpdatedAt'|'Status'|'Name'|'IAMUser'|'TrainingDataSourceId'|'RealtimeEndpointStatus'|'MLModelType'|'Algorithm'|'TrainingDataURI',
EQ='string',
GT='string',
LT='string',
GE='string',
LE='string',
NE='string',
Prefix='string',
SortOrder='asc'|'dsc',
NextToken='string',
Limit=123
)
| Parameters: |
|
|---|---|
| Returns: | None |