Table of Contents
MachineLearning.Client¶A low-level client representing Amazon Machine Learning:
client = session.create_client('machinelearning')
These are the available methods:
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()describe_batch_predictions()describe_data_sources()describe_evaluations()describe_ml_models()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()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.
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 COMPLETED or PENDING status can only be used 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
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 Amazon Redshift . 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 status can only be used 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.
The observations should exist in the database hosted on an Amazon Redshift cluster and should be specified by a SelectSqlQuery . Amazon ML executes Unload command in Amazon Redshift to transfer the result set of SelectSqlQuery to S3StagingLocation.
After the DataSource is created, it's ready for use in evaluations and batch predictions. If you plan to use the DataSource to train an MLModel , the DataSource requires another item -- a recipe. A recipe describes the observation variables that participate in training an MLModel . A recipe describes how each input variable will be used in training. Will the variable be included or excluded from training? Will the variable be manipulated, for example, combined with another variable or split apart into word combinations? The recipe provides answers to these questions. For more information, see the Amazon Machine Learning Developer Guide.
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 is created and ready for use, Amazon ML sets the Status parameter to COMPLETED . DataSource in COMPLETED or PENDING status can only be used 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.
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) bucket, 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 requires another item: a recipe. A recipe describes the observation variables that participate in training an MLModel . A recipe describes how each input variable will be used in training. Will the variable be included or excluded from training? Will the variable be manipulated, for example, combined with another variable, or split apart into word combinations? The recipe provides answers to these questions. For more information, see the Amazon Machine Learning Developer Guide .
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.
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 data files and the recipe as information sources.
An MLModel is nearly immutable. Users can only update 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 is created and ready for use, Amazon ML sets the status to COMPLETED .
You can use the GetMLModel operation to check progress of the MLModel during the creation operation.
CreateMLModel requires aDataSourcewith computed statistics, which can be created by settingComputeStatisticstotruein CreateDataSourceFromRDS , CreateDataSourceFromS3 , or CreateDataSourceFromRedshift operations.
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 .
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.
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.
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.
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.
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 .
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
|
describe_batch_predictions(**kwargs)¶Returns a list of BatchPrediction operations that match the search criteria in the request.
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'
},
],
'NextToken': 'string'
}
Response Structure
|
describe_data_sources(**kwargs)¶Returns a list of DataSource that match the search criteria in the request.
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
},
],
'NextToken': 'string'
}
Response Structure
|
describe_evaluations(**kwargs)¶Returns a list of DescribeEvaluations that match the search criteria in the request.
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'
},
],
'NextToken': 'string'
}
Response Structure
|
describe_ml_models(**kwargs)¶Returns a list of MLModel that match the search criteria in the request.
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'
},
],
'NextToken': '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.
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'
}
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.
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,
'DataSourceSchema': 'string'
}
Response Structure
|
get_evaluation(**kwargs)¶Returns an Evaluation that includes metadata as well as the current status of the Evaluation .
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'
}
Response Structure
|
get_ml_model(**kwargs)¶Returns an MLModel that includes detailed metadata, and data source information as well as the current status of the MLModel .
GetMLModel provides results in normal or verbose format.
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',
'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 MLModel .
Note
Note
Not all response parameters will be populated because this is dependent on the type of requested model.
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.
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.
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.
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.
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.describe_batch_predictionsMachineLearning.Paginator.describe_data_sourcesMachineLearning.Paginator.describe_evaluationsMachineLearning.Paginator.describe_ml_modelsMachineLearning.Paginator.describe_batch_predictions¶paginator = client.get_paginator('describe_batch_predictions')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from MachineLearning.Client.describe_batch_predictions().
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'
},
],
}
Response Structure
|
MachineLearning.Paginator.describe_data_sources¶paginator = client.get_paginator('describe_data_sources')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from MachineLearning.Client.describe_data_sources().
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
},
],
}
Response Structure
|
MachineLearning.Paginator.describe_evaluations¶paginator = client.get_paginator('describe_evaluations')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from MachineLearning.Client.describe_evaluations().
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'
},
],
}
Response Structure
|
MachineLearning.Paginator.describe_ml_models¶paginator = client.get_paginator('describe_ml_models')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from MachineLearning.Client.describe_ml_models().
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'
},
],
}
Response Structure
|
The available waiters are:
MachineLearning.Waiter.batch_prediction_availableMachineLearning.Waiter.data_source_availableMachineLearning.Waiter.evaluation_availableMachineLearning.Waiter.ml_model_availableMachineLearning.Waiter.batch_prediction_available¶waiter = client.get_waiter('batch_prediction_available')
wait(**kwargs)¶This polls MachineLearning.Client.describe_batch_predictions() every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
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.data_source_available¶waiter = client.get_waiter('data_source_available')
wait(**kwargs)¶This polls MachineLearning.Client.describe_data_sources() every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
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.evaluation_available¶waiter = client.get_waiter('evaluation_available')
wait(**kwargs)¶This polls MachineLearning.Client.describe_evaluations() every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
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.ml_model_available¶waiter = client.get_waiter('ml_model_available')
wait(**kwargs)¶This polls MachineLearning.Client.describe_ml_models() every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
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 |