Skip to main content

ml_models

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

Overview

Nameml_models
TypeResource
Idaws.machinelearning.ml_models

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
compute_timeinteger (int64)Long integer type that is a 64-bit signed number.
created_atstring (date-time)A timestamp represented in epoch time.
created_by_iam_userstringThe AWS user account from which the MLModel was created. The account type can be either an AWS root account or an AWS Identity and Access Management (IAM) user account. (pattern: <code>arn:aws:iam::[0-9]+:((user/.+)|(root))</code>)
endpoint_infoobjectThe current endpoint of the MLModel
finished_atstring (date-time)A timestamp represented in epoch time.
input_data_location_s3stringThe location of the data file or directory in Amazon Simple Storage Service (Amazon S3). (pattern: <code>s3:​//([^/]+)(/.*)?</code>)
last_updated_atstring (date-time)A timestamp represented in epoch time.
log_uristringA link to the file that contains logs of the CreateMLModel operation.
ml_model_idstringThe MLModel ID, which is same as the MLModelId in the request. (pattern: <code>[a-zA-Z0-9_.-]+</code>)
ml_model_typestringIdentifies the MLModel category. The following are the available types: REGRESSION -- Produces a numeric result. For example, "What price should a house be listed at?" BINARY -- Produces one of two possible results. For example, "Is this an e-commerce website?" MULTICLASS -- Produces one of several possible results. For example, "Is this a HIGH, LOW or MEDIUM risk trade?" (REGRESSION, BINARY, MULTICLASS)
messagestringA description of the most recent details about accessing the MLModel.
namestringA user-supplied name or description of the MLModel.
recipestringThe recipe to use when training the MLModel. The Recipe provides detailed information about the observation data to use during training, and manipulations to perform on the observation data during training. Note: This parameter is provided as part of the verbose format.
schemastringThe schema used by all of the data files referenced by the DataSource. Note: This parameter is provided as part of the verbose format.
score_thresholdnumber (float)The scoring threshold is used in binary classification MLModel models. It marks the boundary between a positive prediction and a negative prediction. Output values greater than or equal to the threshold receive a positive result from the MLModel, such as true. Output values less than the threshold receive a negative response from the MLModel, such as false.
score_threshold_last_updated_atstring (date-time)A timestamp represented in epoch time.
size_in_bytesinteger (int64)Long integer type that is a 64-bit signed number.
started_atstring (date-time)A timestamp represented in epoch time.
statusstringThe current status of the MLModel. This element can have one of the following values: PENDING - Amazon Machine Learning (Amazon ML) submitted a request to describe a MLModel. INPROGRESS - The request is processing. FAILED - The request did not run to completion. The ML model isn't usable. COMPLETED - The request completed successfully. DELETED - The MLModel is marked as deleted. It isn't usable. (PENDING, INPROGRESS, FAILED, COMPLETED, DELETED)
training_data_source_idstringThe ID of the training DataSource. (pattern: <code>[a-zA-Z0-9_.-]+</code>)
training_parametersobjectA 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 10000. The default value is 10. sgd.shuffleType - Whether Amazon ML shuffles the training data. Shuffling 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.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_ml_modelselectregionReturns an MLModel that includes detailed metadata, data source information, and the current status of the MLModel. GetMLModel provides results in normal or verbose format.
describe_ml_modelsselectregionReturns a list of MLModel that match the search criteria in the request.
create_ml_modelinsertregion, MLModelId, MLModelType, TrainingDataSourceIdCreates 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.
create_realtime_endpointinsertregion, MLModelIdCreates 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.
update_ml_modelupdateregion, MLModelIdUpdates the MLModelName and the ScoreThreshold of an MLModel. You can use the GetMLModel operation to view the contents of the updated data element.
delete_ml_modeldeleteregionAssigns 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.
delete_realtime_endpointexecregion, MLModelIdDeletes a real time endpoint of an MLModel.
predictexecregion, MLModelId, Record, PredictEndpointGenerates a prediction for the observation using the specified ML Model. Note: Not all response parameters will be populated. Whether a response parameter is populated depends on the type of model requested.

Parameters

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

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

SELECT examples

Returns an MLModel that includes detailed metadata, data source information, and the current status of the MLModel. GetMLModel provides results in normal or verbose format.

SELECT
compute_time,
created_at,
created_by_iam_user,
endpoint_info,
finished_at,
input_data_location_s3,
last_updated_at,
log_uri,
ml_model_id,
ml_model_type,
message,
name,
recipe,
schema,
score_threshold,
score_threshold_last_updated_at,
size_in_bytes,
started_at,
status,
training_data_source_id,
training_parameters
FROM aws.machinelearning.ml_models
WHERE region = '{{ region }}' -- required
;

INSERT examples

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.

INSERT INTO aws.machinelearning.ml_models (
MLModelId,
MLModelName,
MLModelType,
Parameters,
TrainingDataSourceId,
Recipe,
RecipeUri,
region
)
SELECT
'{{ MLModelId }}' /* required */,
'{{ MLModelName }}',
'{{ MLModelType }}' /* required */,
'{{ Parameters }}',
'{{ TrainingDataSourceId }}' /* required */,
'{{ Recipe }}',
'{{ RecipeUri }}',
'{{ region }}'
RETURNING
ml_model_id
;

UPDATE examples

Updates the MLModelName and the ScoreThreshold of an MLModel. You can use the GetMLModel operation to view the contents of the updated data element.

UPDATE aws.machinelearning.ml_models
SET
MLModelId = '{{ MLModelId }}',
MLModelName = '{{ MLModelName }}',
ScoreThreshold = {{ ScoreThreshold }}
WHERE
region = '{{ region }}' --required
AND MLModelId = '{{ MLModelId }}' --required
RETURNING
ml_model_id;

DELETE examples

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.

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

Lifecycle Methods

Deletes a real time endpoint of an MLModel.

EXEC aws.machinelearning.ml_models.delete_realtime_endpoint
@region='{{ region }}' --required
@@json=
'{
"MLModelId": "{{ MLModelId }}"
}'
;