models
Creates, updates, deletes, gets or lists a models resource.
Overview
| Name | models |
| Type | Resource |
| Id | aws.lookoutequipment.models |
Fields
The following fields are returned by SELECT queries:
- describe_model
- list_models
| Name | Datatype | Description |
|---|---|---|
accumulated_inference_data_end_time | string (date-time) | Indicates the end time of the inference data that has been accumulated. |
accumulated_inference_data_start_time | string (date-time) | Indicates the start time of the inference data that has been accumulated. |
active_model_version | integer (int64) | The name of the model version used by the inference schedular when running a scheduled inference execution. |
active_model_version_arn | string | The Amazon Resource Name (ARN) of the model version used by the inference scheduler when running a scheduled inference execution. (pattern: <code>^arn:aws(-[^:]+)?:lookoutequipment:[a-zA-Z0-9-]*:[0-9]{12}:model/[0-9a-zA-Z_-]{1,200}/.+/model-version/[0-9]{1,}$</code>) |
created_at | string (date-time) | Indicates the time and date at which the machine learning model was created. |
data_pre_processing_configuration | object | The configuration is the TargetSamplingRate, which is the sampling rate of the data after post processing by Amazon Lookout for Equipment. For example, if you provide data that has been collected at a 1 second level and you want the system to resample the data at a 1 minute rate before training, the TargetSamplingRate is 1 minute. When providing a value for the TargetSamplingRate, you must attach the prefix "PT" to the rate you want. The value for a 1 second rate is therefore PT1S, the value for a 15 minute rate is PT15M, and the value for a 1 hour rate is PT1H |
dataset_arn | string | The Amazon Resouce Name (ARN) of the dataset used to create the machine learning model being described. (pattern: <code>arn:aws(-[^:]+)?:lookoutequipment:[a-zA-Z0-9-]*:[0-9]{12}:dataset/[0-9a-zA-Z_-]{1,200}/.+</code>) |
dataset_name | string | The name of the dataset being used by the machine learning being described. (pattern: <code>^[0-9a-zA-Z_-]{1,200}$</code>) |
evaluation_data_end_time | string (date-time) | Indicates the time reference in the dataset that was used to end the subset of evaluation data for the machine learning model. |
evaluation_data_start_time | string (date-time) | Indicates the time reference in the dataset that was used to begin the subset of evaluation data for the machine learning model. |
failed_reason | string | If the training of the machine learning model failed, this indicates the reason for that failure. (pattern: <code>[\P{M}\p{M}]{1,5000}</code>) |
import_job_end_time | string (date-time) | The date and time when the import job was completed. This field appears if the active model version was imported. |
import_job_start_time | string (date-time) | The date and time when the import job was started. This field appears if the active model version was imported. |
labels_input_configuration | object | Specifies configuration information about the labels input, including its S3 location. |
last_updated_time | string (date-time) | Indicates the last time the machine learning model was updated. The type of update is not specified. |
latest_scheduled_retraining_available_data_in_days | integer | Indicates the number of days of data used in the most recent scheduled retraining run. |
latest_scheduled_retraining_failed_reason | string | If the model version was generated by retraining and the training failed, this indicates the reason for that failure. (pattern: <code>[\P{M}\p{M}]{1,5000}</code>) |
latest_scheduled_retraining_model_version | integer (int64) | Indicates the most recent model version that was generated by retraining. |
latest_scheduled_retraining_start_time | string (date-time) | Indicates the start time of the most recent scheduled retraining run. |
latest_scheduled_retraining_status | string | Indicates the status of the most recent scheduled retraining run. (IN_PROGRESS, SUCCESS, FAILED, IMPORT_IN_PROGRESS, CANCELED) |
model_arn | string | The Amazon Resource Name (ARN) of the machine learning model being described. (pattern: <code>arn:aws(-[^:]+)?:lookoutequipment:[a-zA-Z0-9-]*:[0-9]{12}:model/.+</code>) |
model_diagnostics_output_configuration | object | Configuration information for the model's pointwise model diagnostics. |
model_metrics | string | The Model Metrics show an aggregated summary of the model's performance within the evaluation time range. This is the JSON content of the metrics created when evaluating the model. |
model_name | string | The name of the machine learning model being described. (pattern: <code>^[0-9a-zA-Z_-]{1,200}$</code>) |
model_quality | string | Provides a quality assessment for a model that uses labels. If Lookout for Equipment determines that the model quality is poor based on training metrics, the value is POOR_QUALITY_DETECTED. Otherwise, the value is QUALITY_THRESHOLD_MET. If the model is unlabeled, the model quality can't be assessed and the value of ModelQuality is CANNOT_DETERMINE_QUALITY. In this situation, you can get a model quality assessment by adding labels to the input dataset and retraining the model. For information about using labels with your models, see Understanding labeling. For information about improving the quality of a model, see Best practices with Amazon Lookout for Equipment. (QUALITY_THRESHOLD_MET, CANNOT_DETERMINE_QUALITY, POOR_QUALITY_DETECTED) |
model_version_activated_at | string (date-time) | The date the active model version was activated. |
next_scheduled_retraining_start_date | string (date-time) | Indicates the date and time that the next scheduled retraining run will start on. Lookout for Equipment truncates the time you provide to the nearest UTC day. |
off_condition | string | Indicates that the asset associated with this sensor has been shut off. As long as this condition is met, Lookout for Equipment will not use data from this asset for training, evaluation, or inference. |
previous_active_model_version | integer (int64) | The model version that was set as the active model version prior to the current active model version. |
previous_active_model_version_arn | string | The ARN of the model version that was set as the active model version prior to the current active model version. (pattern: <code>^arn:aws(-[^:]+)?:lookoutequipment:[a-zA-Z0-9-]*:[0-9]{12}:model/[0-9a-zA-Z_-]{1,200}/.+/model-version/[0-9]{1,}$</code>) |
previous_model_version_activated_at | string (date-time) | The date and time when the previous active model version was activated. |
prior_model_metrics | string | If the model version was retrained, this field shows a summary of the performance of the prior model on the new training range. You can use the information in this JSON-formatted object to compare the new model version and the prior model version. |
retraining_scheduler_status | string | Indicates the status of the retraining scheduler. (PENDING, RUNNING, STOPPING, STOPPED) |
role_arn | string | The Amazon Resource Name (ARN) of a role with permission to access the data source for the machine learning model being described. (pattern: <code>arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+</code>) |
schema | string | A JSON description of the data that is in each time series dataset, including names, column names, and data types. |
server_side_kms_key_id | string | Provides the identifier of the KMS key used to encrypt model data by Amazon Lookout for Equipment. (pattern: <code>arn:aws[a-z-]:kms:[a-z0-9-]:\d{12}:[\w-/]+</code>) |
source_model_version_arn | string | The Amazon Resource Name (ARN) of the source model version. This field appears if the active model version was imported. (pattern: <code>^arn:aws(-[^:]+)?:lookoutequipment:[a-zA-Z0-9-]*:[0-9]{12}:model/[0-9a-zA-Z_-]{1,200}/.+/model-version/[0-9]{1,}$</code>) |
status | string | Specifies the current status of the model being described. Status describes the status of the most recent action of the model. (IN_PROGRESS, SUCCESS, FAILED, IMPORT_IN_PROGRESS) |
training_data_end_time | string (date-time) | Indicates the time reference in the dataset that was used to end the subset of training data for the machine learning model. |
training_data_start_time | string (date-time) | Indicates the time reference in the dataset that was used to begin the subset of training data for the machine learning model. |
training_execution_end_time | string (date-time) | Indicates the time at which the training of the machine learning model was completed. |
training_execution_start_time | string (date-time) | Indicates the time at which the training of the machine learning model began. |
| Name | Datatype | Description |
|---|---|---|
model_summaries | array | Provides information on the specified model, including created time, model and dataset ARNs, and status. |
next_token | string | An opaque pagination token indicating where to continue the listing of machine learning models. (pattern: <code>\p{ASCII}{0,8192}</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_model | select | region | Provides a JSON containing the overall information about a specific machine learning model, including model name and ARN, dataset, training and evaluation information, status, and so on. | |
list_models | select | region | Generates a list of all models in the account, including model name and ARN, dataset, and status. | |
create_model | insert | region, ModelName, DatasetName, ClientToken | Creates a machine learning model for data inference. A machine-learning (ML) model is a mathematical model that finds patterns in your data. In Amazon Lookout for Equipment, the model learns the patterns of normal behavior and detects abnormal behavior that could be potential equipment failure (or maintenance events). The models are made by analyzing normal data and abnormalities in machine behavior that have already occurred. Your model is trained using a portion of the data from your dataset and uses that data to learn patterns of normal behavior and abnormal patterns that lead to equipment failure. Another portion of the data is used to evaluate the model's accuracy. | |
update_model | update | region, ModelName | Updates a model in the account. | |
delete_model | delete | region | Deletes a machine learning model currently available for Amazon Lookout for Equipment. This will prevent it from being used with an inference scheduler, even one that is already set up. | |
import_model_version | exec | region, SourceModelVersionArn, DatasetName, ClientToken | Imports a model that has been trained successfully. | |
start_retraining_scheduler | exec | region, ModelName | Starts a retraining scheduler. | |
stop_retraining_scheduler | exec | region, ModelName | Stops a retraining scheduler. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_model
- list_models
Provides a JSON containing the overall information about a specific machine learning model, including model name and ARN, dataset, training and evaluation information, status, and so on.
SELECT
accumulated_inference_data_end_time,
accumulated_inference_data_start_time,
active_model_version,
active_model_version_arn,
created_at,
data_pre_processing_configuration,
dataset_arn,
dataset_name,
evaluation_data_end_time,
evaluation_data_start_time,
failed_reason,
import_job_end_time,
import_job_start_time,
labels_input_configuration,
last_updated_time,
latest_scheduled_retraining_available_data_in_days,
latest_scheduled_retraining_failed_reason,
latest_scheduled_retraining_model_version,
latest_scheduled_retraining_start_time,
latest_scheduled_retraining_status,
model_arn,
model_diagnostics_output_configuration,
model_metrics,
model_name,
model_quality,
model_version_activated_at,
next_scheduled_retraining_start_date,
off_condition,
previous_active_model_version,
previous_active_model_version_arn,
previous_model_version_activated_at,
prior_model_metrics,
retraining_scheduler_status,
role_arn,
schema,
server_side_kms_key_id,
source_model_version_arn,
status,
training_data_end_time,
training_data_start_time,
training_execution_end_time,
training_execution_start_time
FROM aws.lookoutequipment.models
WHERE region = '{{ region }}' -- required
;
Generates a list of all models in the account, including model name and ARN, dataset, and status.
SELECT
model_summaries,
next_token
FROM aws.lookoutequipment.models
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_model
- Manifest
Creates a machine learning model for data inference. A machine-learning (ML) model is a mathematical model that finds patterns in your data. In Amazon Lookout for Equipment, the model learns the patterns of normal behavior and detects abnormal behavior that could be potential equipment failure (or maintenance events). The models are made by analyzing normal data and abnormalities in machine behavior that have already occurred. Your model is trained using a portion of the data from your dataset and uses that data to learn patterns of normal behavior and abnormal patterns that lead to equipment failure. Another portion of the data is used to evaluate the model's accuracy.
INSERT INTO aws.lookoutequipment.models (
ModelName,
DatasetName,
DatasetSchema,
LabelsInputConfiguration,
ClientToken,
TrainingDataStartTime,
TrainingDataEndTime,
EvaluationDataStartTime,
EvaluationDataEndTime,
RoleArn,
DataPreProcessingConfiguration,
ServerSideKmsKeyId,
Tags,
OffCondition,
ModelDiagnosticsOutputConfiguration,
region
)
SELECT
'{{ ModelName }}' /* required */,
'{{ DatasetName }}' /* required */,
'{{ DatasetSchema }}',
'{{ LabelsInputConfiguration }}',
'{{ ClientToken }}' /* required */,
'{{ TrainingDataStartTime }}',
'{{ TrainingDataEndTime }}',
'{{ EvaluationDataStartTime }}',
'{{ EvaluationDataEndTime }}',
'{{ RoleArn }}',
'{{ DataPreProcessingConfiguration }}',
'{{ ServerSideKmsKeyId }}',
'{{ Tags }}',
'{{ OffCondition }}',
'{{ ModelDiagnosticsOutputConfiguration }}',
'{{ region }}'
RETURNING
model_arn,
status
;
# Description fields are for documentation purposes
- name: models
props:
- name: region
value: "{{ region }}"
description: Required parameter for the models resource.
- name: ModelName
value: "{{ ModelName }}"
description: |
The name for the machine learning model to be created.
- name: DatasetName
value: "{{ DatasetName }}"
description: |
The name of the dataset for the machine learning model being created.
- name: DatasetSchema
description: |
The data schema for the machine learning model being created.
value:
InlineDataSchema: "{{ InlineDataSchema }}"
- name: LabelsInputConfiguration
description: |
The input configuration for the labels being used for the machine learning model that's being created.
value:
S3InputConfiguration:
Bucket: "{{ Bucket }}"
Prefix: "{{ Prefix }}"
LabelGroupName: "{{ LabelGroupName }}"
- name: ClientToken
value: "{{ ClientToken }}"
description: |
A unique identifier for the request. If you do not set the client request token, Amazon Lookout for Equipment generates one.
- name: TrainingDataStartTime
value: "{{ TrainingDataStartTime }}"
description: |
Indicates the time reference in the dataset that should be used to begin the subset of training data for the machine learning model.
- name: TrainingDataEndTime
value: "{{ TrainingDataEndTime }}"
description: |
Indicates the time reference in the dataset that should be used to end the subset of training data for the machine learning model.
- name: EvaluationDataStartTime
value: "{{ EvaluationDataStartTime }}"
description: |
Indicates the time reference in the dataset that should be used to begin the subset of evaluation data for the machine learning model.
- name: EvaluationDataEndTime
value: "{{ EvaluationDataEndTime }}"
description: |
Indicates the time reference in the dataset that should be used to end the subset of evaluation data for the machine learning model.
- name: RoleArn
value: "{{ RoleArn }}"
description: |
The Amazon Resource Name (ARN) of a role with permission to access the data source being used to create the machine learning model.
- name: DataPreProcessingConfiguration
description: |
The configuration is the TargetSamplingRate, which is the sampling rate of the data after post processing by Amazon Lookout for Equipment. For example, if you provide data that has been collected at a 1 second level and you want the system to resample the data at a 1 minute rate before training, the TargetSamplingRate is 1 minute. When providing a value for the TargetSamplingRate, you must attach the prefix "PT" to the rate you want. The value for a 1 second rate is therefore PT1S, the value for a 15 minute rate is PT15M, and the value for a 1 hour rate is PT1H
value:
TargetSamplingRate: "{{ TargetSamplingRate }}"
- name: ServerSideKmsKeyId
value: "{{ ServerSideKmsKeyId }}"
description: |
Provides the identifier of the KMS key used to encrypt model data by Amazon Lookout for Equipment.
- name: Tags
description: |
Any tags associated with the machine learning model being created.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: OffCondition
value: "{{ OffCondition }}"
description: |
Indicates that the asset associated with this sensor has been shut off. As long as this condition is met, Lookout for Equipment will not use data from this asset for training, evaluation, or inference.
- name: ModelDiagnosticsOutputConfiguration
description: |
The Amazon S3 location where you want Amazon Lookout for Equipment to save the pointwise model diagnostics. You must also specify the RoleArn request parameter.
value:
S3OutputConfiguration:
Bucket: "{{ Bucket }}"
Prefix: "{{ Prefix }}"
KmsKeyId: "{{ KmsKeyId }}"
UPDATE examples
- update_model
Updates a model in the account.
UPDATE aws.lookoutequipment.models
SET
ModelName = '{{ ModelName }}',
LabelsInputConfiguration = '{{ LabelsInputConfiguration }}',
RoleArn = '{{ RoleArn }}',
ModelDiagnosticsOutputConfiguration = '{{ ModelDiagnosticsOutputConfiguration }}'
WHERE
region = '{{ region }}' --required
AND ModelName = '{{ ModelName }}' --required;
DELETE examples
- delete_model
Deletes a machine learning model currently available for Amazon Lookout for Equipment. This will prevent it from being used with an inference scheduler, even one that is already set up.
DELETE FROM aws.lookoutequipment.models
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- import_model_version
- start_retraining_scheduler
- stop_retraining_scheduler
Imports a model that has been trained successfully.
EXEC aws.lookoutequipment.models.import_model_version
@region='{{ region }}' --required
@@json=
'{
"SourceModelVersionArn": "{{ SourceModelVersionArn }}",
"ModelName": "{{ ModelName }}",
"DatasetName": "{{ DatasetName }}",
"LabelsInputConfiguration": "{{ LabelsInputConfiguration }}",
"ClientToken": "{{ ClientToken }}",
"RoleArn": "{{ RoleArn }}",
"ServerSideKmsKeyId": "{{ ServerSideKmsKeyId }}",
"Tags": "{{ Tags }}",
"InferenceDataImportStrategy": "{{ InferenceDataImportStrategy }}"
}'
;
Starts a retraining scheduler.
EXEC aws.lookoutequipment.models.start_retraining_scheduler
@region='{{ region }}' --required
@@json=
'{
"ModelName": "{{ ModelName }}"
}'
;
Stops a retraining scheduler.
EXEC aws.lookoutequipment.models.stop_retraining_scheduler
@region='{{ region }}' --required
@@json=
'{
"ModelName": "{{ ModelName }}"
}'
;