Skip to main content

model_versions

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

Overview​

Namemodel_versions
TypeResource
Idaws.frauddetector.model_versions

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe 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_detailobjectThe details of the external events data used for training the model version. This will be populated if the trainingDataSource is EXTERNAL_EVENTS
ingested_events_detailobjectThe details of the ingested events data used for training the model version. This will be populated if the trainingDataSource is INGESTED_EVENTS.
model_idstringThe model ID. (pattern: <code>^[0-9a-z_]+$</code>)
model_typestringThe model type. (ONLINE_FRAUD_INSIGHTS, TRANSACTION_FRAUD_INSIGHTS, ACCOUNT_TAKEOVER_INSIGHTS)
model_version_numberstringThe model version number. (pattern: <code>^[1-9][0-9]{0,3}.[0-9]{1,2}$</code>)
statusstringThe 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_schemaobjectThe training data schema.
training_data_sourcestringThe training data source. (EXTERNAL_EVENTS, INGESTED_EVENTS)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_model_versionselectregionGets the details of the specified model version.
describe_model_versionsselectregionGets 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_versioninsertregion, modelId, modelType, trainingDataSource, trainingDataSchemaCreates a version of the model using the specified model type and model id.
update_model_version_statusupdateregion, modelId, modelType, modelVersionNumber, statusUpdates 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_versionupdateregion, modelId, modelType, majorVersionNumberUpdates 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_versiondeleteregionDeletes 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.

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

SELECT examples​

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
;

INSERT examples​

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
;

UPDATE examples​

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;

DELETE examples​

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
;