model_versions
Creates, updates, deletes, gets or lists a model_versions resource.
Overview
| Name | model_versions |
| Type | Resource |
| Id | aws.frauddetector.model_versions |
Fields
The following fields are returned by SELECT queries:
- get_model_version
- describe_model_versions
| Name | Datatype | Description |
|---|---|---|
arn | string | The model version ARN. (pattern: <code>^arn:aws[a-z-]{0,15}:frauddetector:[a-z0-9-]{3,20}:[0-9]{12}:[^\s]{2,128}$</code>) |
external_events_detail | object | The details of the external events data used for training the model version. This will be populated if the trainingDataSource is EXTERNAL_EVENTS |
ingested_events_detail | object | The details of the ingested events data used for training the model version. This will be populated if the trainingDataSource is INGESTED_EVENTS. |
model_id | string | The model ID. (pattern: <code>^[0-9a-z_]+$</code>) |
model_type | string | The model type. (ONLINE_FRAUD_INSIGHTS, TRANSACTION_FRAUD_INSIGHTS, ACCOUNT_TAKEOVER_INSIGHTS) |
model_version_number | string | The model version number. (pattern: <code>^[1-9][0-9]{0,3}.[0-9]{1,2}$</code>) |
status | string | The model version status. Possible values are: TRAINING_IN_PROGRESS TRAINING_COMPLETE ACTIVATE_REQUESTED ACTIVATE_IN_PROGRESS ACTIVE INACTIVATE_REQUESTED INACTIVATE_IN_PROGRESS INACTIVE ERROR |
training_data_schema | object | The training data schema. |
training_data_source | string | The training data source. (EXTERNAL_EVENTS, INGESTED_EVENTS) |
| Name | Datatype | Description |
|---|---|---|
model_version_details | array | The model version details. |
next_token | string | The next token. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_model_version | select | region | Gets the details of the specified model version. | |
describe_model_versions | select | region | Gets all of the model versions for the specified model type or for the specified model type and model ID. You can also get details for a single, specified model version. | |
create_model_version | insert | region, modelId, modelType, trainingDataSource, trainingDataSchema | Creates a version of the model using the specified model type and model id. | |
update_model_version_status | update | region, modelId, modelType, modelVersionNumber, status | Updates the status of a model version. You can perform the following status updates: Change the TRAINING_IN_PROGRESS status to TRAINING_CANCELLED. Change the TRAINING_COMPLETE status to ACTIVE. Change ACTIVE to INACTIVE. | |
update_model_version | update | region, modelId, modelType, majorVersionNumber | Updates a model version. Updating a model version retrains an existing model version using updated training data and produces a new minor version of the model. You can update the training data set location and data access role attributes using this action. This action creates and trains a new minor version of the model, for example version 1.01, 1.02, 1.03. | |
delete_model_version | delete | region | Deletes a model version. You can delete models and model versions in Amazon Fraud Detector, provided that they are not associated with a detector version. When you delete a model version, Amazon Fraud Detector permanently deletes that model version and the data is no longer stored in Amazon Fraud Detector. |
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
- get_model_version
- describe_model_versions
Gets the details of the specified model version.
SELECT
arn,
external_events_detail,
ingested_events_detail,
model_id,
model_type,
model_version_number,
status,
training_data_schema,
training_data_source
FROM aws.frauddetector.model_versions
WHERE region = '{{ region }}' -- required
;
Gets all of the model versions for the specified model type or for the specified model type and model ID. You can also get details for a single, specified model version.
SELECT
model_version_details,
next_token
FROM aws.frauddetector.model_versions
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_model_version
- Manifest
Creates a version of the model using the specified model type and model id.
INSERT INTO aws.frauddetector.model_versions (
modelId,
modelType,
trainingDataSource,
trainingDataSchema,
externalEventsDetail,
ingestedEventsDetail,
tags,
region
)
SELECT
'{{ modelId }}' /* required */,
'{{ modelType }}' /* required */,
'{{ trainingDataSource }}' /* required */,
'{{ trainingDataSchema }}' /* required */,
'{{ externalEventsDetail }}',
'{{ ingestedEventsDetail }}',
'{{ tags }}',
'{{ region }}'
RETURNING
model_id,
model_type,
model_version_number,
status
;
# Description fields are for documentation purposes
- name: model_versions
props:
- name: region
value: "{{ region }}"
description: Required parameter for the model_versions resource.
- name: modelId
value: "{{ modelId }}"
description: |
The model ID.
- name: modelType
value: "{{ modelType }}"
description: |
The model type.
valid_values: ['ONLINE_FRAUD_INSIGHTS', 'TRANSACTION_FRAUD_INSIGHTS', 'ACCOUNT_TAKEOVER_INSIGHTS']
- name: trainingDataSource
value: "{{ trainingDataSource }}"
description: |
The training data source location in Amazon S3.
valid_values: ['EXTERNAL_EVENTS', 'INGESTED_EVENTS']
- name: trainingDataSchema
description: |
The training data schema.
value:
modelVariables:
- "{{ modelVariables }}"
labelSchema:
labelMapper: "{{ labelMapper }}"
unlabeledEventsTreatment: "{{ unlabeledEventsTreatment }}"
- name: externalEventsDetail
description: |
Details of the external events data used for model version training. Required if trainingDataSource is EXTERNAL_EVENTS.
value:
dataLocation: "{{ dataLocation }}"
dataAccessRoleArn: "{{ dataAccessRoleArn }}"
- name: ingestedEventsDetail
description: |
Details of the ingested events data used for model version training. Required if trainingDataSource is INGESTED_EVENTS.
value:
ingestedEventsTimeWindow:
startTime: "{{ startTime }}"
endTime: "{{ endTime }}"
- name: tags
description: |
A collection of key and value pairs.
value:
- key: "{{ key }}"
value: "{{ value }}"
UPDATE examples
- update_model_version_status
- update_model_version
Updates the status of a model version. You can perform the following status updates: Change the TRAINING_IN_PROGRESS status to TRAINING_CANCELLED. Change the TRAINING_COMPLETE status to ACTIVE. Change ACTIVE to INACTIVE.
UPDATE aws.frauddetector.model_versions
SET
modelId = '{{ modelId }}',
modelType = '{{ modelType }}',
modelVersionNumber = '{{ modelVersionNumber }}',
status = '{{ status }}'
WHERE
region = '{{ region }}' --required
AND modelId = '{{ modelId }}' --required
AND modelType = '{{ modelType }}' --required
AND modelVersionNumber = '{{ modelVersionNumber }}' --required
AND status = '{{ status }}' --required;
Updates a model version. Updating a model version retrains an existing model version using updated training data and produces a new minor version of the model. You can update the training data set location and data access role attributes using this action. This action creates and trains a new minor version of the model, for example version 1.01, 1.02, 1.03.
UPDATE aws.frauddetector.model_versions
SET
modelId = '{{ modelId }}',
modelType = '{{ modelType }}',
majorVersionNumber = '{{ majorVersionNumber }}',
externalEventsDetail = '{{ externalEventsDetail }}',
ingestedEventsDetail = '{{ ingestedEventsDetail }}',
tags = '{{ tags }}'
WHERE
region = '{{ region }}' --required
AND modelId = '{{ modelId }}' --required
AND modelType = '{{ modelType }}' --required
AND majorVersionNumber = '{{ majorVersionNumber }}' --required
RETURNING
model_id,
model_type,
model_version_number,
status;
DELETE examples
- delete_model_version
Deletes a model version. You can delete models and model versions in Amazon Fraud Detector, provided that they are not associated with a detector version. When you delete a model version, Amazon Fraud Detector permanently deletes that model version and the data is no longer stored in Amazon Fraud Detector.
DELETE FROM aws.frauddetector.model_versions
WHERE region = '{{ region }}' --required
;