2021/10/11 - Amazon Fraud Detector - 9 new 17 updated api methods
Changes New model type: Transaction Fraud Insights, which is optimized for online transaction fraud. Stored Events, which allows customers to send and store data directly within Amazon Fraud Detector. Batch Import, which allows customers to upload a CSV file of historic event data for processing and storage
Retrieves details of events stored with Amazon Fraud Detector. This action does not retrieve prediction results.
See also: AWS API Documentation
Request Syntax
client.get_event( eventId='string', eventTypeName='string' )
string
[REQUIRED]
The ID of the event to retrieve.
string
[REQUIRED]
The event type of the event to retrieve.
dict
Response Syntax
{ 'event': { 'eventId': 'string', 'eventTypeName': 'string', 'eventTimestamp': 'string', 'eventVariables': { 'string': 'string' }, 'currentLabel': 'string', 'labelTimestamp': 'string', 'entities': [ { 'entityType': 'string', 'entityId': 'string' }, ] } }
Response Structure
(dict) --
event (dict) --
The details of the event.
eventId (string) --
The event ID.
eventTypeName (string) --
The event type.
eventTimestamp (string) --
The timestamp that defines when the event under evaluation occurred. The timestamp must be specified using ISO 8601 standard in UTC.
eventVariables (dict) --
Names of the event type's variables you defined in Amazon Fraud Detector to represent data elements and their corresponding values for the event you are sending for evaluation.
(string) --
(string) --
currentLabel (string) --
The label associated with the event.
labelTimestamp (string) --
The timestamp associated with the label to update. The timestamp must be specified using ISO 8601 standard in UTC.
entities (list) --
The event entities.
(dict) --
The entity details.
entityType (string) --
The entity type.
entityId (string) --
The entity ID. If you do not know the entityId , you can pass unknown , which is areserved string literal.
Retrieves the status of a DeleteEventsByEventType action.
See also: AWS API Documentation
Request Syntax
client.get_delete_events_by_event_type_status( eventTypeName='string' )
string
[REQUIRED]
Name of event type for which to get the deletion status.
dict
Response Syntax
{ 'eventTypeName': 'string', 'eventsDeletionStatus': 'IN_PROGRESS_INITIALIZING'|'IN_PROGRESS'|'CANCEL_IN_PROGRESS'|'CANCELED'|'COMPLETE'|'FAILED' }
Response Structure
(dict) --
eventTypeName (string) --
The event type name.
eventsDeletionStatus (string) --
The deletion status.
Stores events in Amazon Fraud Detector without generating fraud predictions for those events. For example, you can use SendEvent to upload a historical dataset, which you can then later use to train a model.
See also: AWS API Documentation
Request Syntax
client.send_event( eventId='string', eventTypeName='string', eventTimestamp='string', eventVariables={ 'string': 'string' }, assignedLabel='string', labelTimestamp='string', entities=[ { 'entityType': 'string', 'entityId': 'string' }, ] )
string
[REQUIRED]
The event ID to upload.
string
[REQUIRED]
The event type name of the event.
string
[REQUIRED]
The timestamp that defines when the event under evaluation occurred. The timestamp must be specified using ISO 8601 standard in UTC.
dict
[REQUIRED]
Names of the event type's variables you defined in Amazon Fraud Detector to represent data elements and their corresponding values for the event you are sending for evaluation.
(string) --
(string) --
string
The label to associate with the event. Required if specifying labelTimestamp .
string
The timestamp associated with the label. Required if specifying assignedLabel .
list
[REQUIRED]
An array of entities.
(dict) --
The entity details.
entityType (string) -- [REQUIRED]
The entity type.
entityId (string) -- [REQUIRED]
The entity ID. If you do not know the entityId , you can pass unknown , which is areserved string literal.
dict
Response Syntax
{}
Response Structure
(dict) --
Cancels an in-progress batch import job.
See also: AWS API Documentation
Request Syntax
client.cancel_batch_import_job( jobId='string' )
string
[REQUIRED]
The ID of an in-progress batch import job to cancel.
Amazon Fraud Detector will throw an error if the batch import job is in FAILED , CANCELED , or COMPLETED state.
dict
Response Syntax
{}
Response Structure
(dict) --
Gets all batch import jobs or a specific job of the specified ID. This is a paginated API. If you provide a null maxResults , this action retrieves a maximum of 50 records per page. If you provide a maxResults , the value must be between 1 and 50. To get the next page results, provide the pagination token from the GetBatchImportJobsResponse as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
client.get_batch_import_jobs( jobId='string', maxResults=123, nextToken='string' )
string
The ID of the batch import job to get.
integer
The maximum number of objects to return for request.
string
The next token from the previous request.
dict
Response Syntax
{ 'batchImports': [ { 'jobId': 'string', 'status': 'IN_PROGRESS_INITIALIZING'|'IN_PROGRESS'|'CANCEL_IN_PROGRESS'|'CANCELED'|'COMPLETE'|'FAILED', 'failureReason': 'string', 'startTime': 'string', 'completionTime': 'string', 'inputPath': 'string', 'outputPath': 'string', 'eventTypeName': 'string', 'iamRoleArn': 'string', 'arn': 'string', 'processedRecordsCount': 123, 'failedRecordsCount': 123, 'totalRecordsCount': 123 }, ], 'nextToken': 'string' }
Response Structure
(dict) --
batchImports (list) --
An array containing the details of each batch import job.
(dict) --
The batch import job details.
jobId (string) --
The ID of the batch import job.
status (string) --
The status of the batch import job.
failureReason (string) --
The reason batch import job failed.
startTime (string) --
Timestamp of when the batch import job started.
completionTime (string) --
Timestamp of when batch import job completed.
inputPath (string) --
The Amazon S3 location of your data file for batch import.
outputPath (string) --
The Amazon S3 location of your output file.
eventTypeName (string) --
The name of the event type.
iamRoleArn (string) --
The ARN of the IAM role to use for this job request.
arn (string) --
The ARN of the batch import job.
processedRecordsCount (integer) --
The number of records processed by batch import job.
failedRecordsCount (integer) --
The number of records that failed to import.
totalRecordsCount (integer) --
The total number of records in the batch import job.
nextToken (string) --
The next token for the subsequent resquest.
Deletes data that was batch imported to Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
client.delete_batch_import_job( jobId='string' )
string
[REQUIRED]
The ID of the batch import job to delete.
dict
Response Syntax
{}
Response Structure
(dict) --
Updates the specified event with a new label.
See also: AWS API Documentation
Request Syntax
client.update_event_label( eventId='string', eventTypeName='string', assignedLabel='string', labelTimestamp='string' )
string
[REQUIRED]
The ID of the event associated with the label to update.
string
[REQUIRED]
The event type of the event associated with the label to update.
string
[REQUIRED]
The new label to assign to the event.
string
[REQUIRED]
The timestamp associated with the label. The timestamp must be specified using ISO 8601 standard in UTC.
dict
Response Syntax
{}
Response Structure
(dict) --
Deletes all events of a particular event type.
See also: AWS API Documentation
Request Syntax
client.delete_events_by_event_type( eventTypeName='string' )
string
[REQUIRED]
The name of the event type.
dict
Response Syntax
{ 'eventTypeName': 'string', 'eventsDeletionStatus': 'string' }
Response Structure
(dict) --
eventTypeName (string) --
Name of event type for which to delete the events.
eventsDeletionStatus (string) --
The status of the delete request.
Creates a batch import job.
See also: AWS API Documentation
Request Syntax
client.create_batch_import_job( jobId='string', inputPath='string', outputPath='string', eventTypeName='string', iamRoleArn='string', tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The ID of the batch import job. The ID cannot be of a past job, unless the job exists in CREATE_FAILED state.
string
[REQUIRED]
The URI that points to the Amazon S3 location of your data file.
string
[REQUIRED]
The URI that points to the Amazon S3 location for storing your results.
string
[REQUIRED]
The name of the event type.
string
[REQUIRED]
The ARN of the IAM role created for Amazon S3 bucket that holds your data file. The IAM role must have read and write permissions to both input and output S3 buckets.
list
A collection of key-value pairs associated with this request.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
(dict) --
{'modelVersions': {'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}}
Creates a detector version. The detector version starts in a DRAFT status.
See also: AWS API Documentation
Request Syntax
client.create_detector_version( detectorId='string', description='string', externalModelEndpoints=[ 'string', ], rules=[ { 'detectorId': 'string', 'ruleId': 'string', 'ruleVersion': 'string' }, ], modelVersions=[ { 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', 'modelVersionNumber': 'string', 'arn': 'string' }, ], ruleExecutionMode='ALL_MATCHED'|'FIRST_MATCHED', tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The ID of the detector under which you want to create a new version.
string
The description of the detector version.
list
The Amazon Sagemaker model endpoints to include in the detector version.
(string) --
list
[REQUIRED]
The rules to include in the detector version.
(dict) --
A rule.
detectorId (string) -- [REQUIRED]
The detector for which the rule is associated.
ruleId (string) -- [REQUIRED]
The rule ID.
ruleVersion (string) -- [REQUIRED]
The rule version.
list
The model versions to include in the detector version.
(dict) --
The model version.
modelId (string) -- [REQUIRED]
The model ID.
modelType (string) -- [REQUIRED]
The model type.
modelVersionNumber (string) -- [REQUIRED]
The model version number.
arn (string) --
The model version ARN.
string
The rule execution mode for the rules included in the detector version.
You can define and edit the rule mode at the detector version level, when it is in draft status.
If you specify FIRST_MATCHED , Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule.
If you specifiy ALL_MATCHED , Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules.
The default behavior is FIRST_MATCHED .
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
Response Syntax
{ 'detectorId': 'string', 'detectorVersionId': 'string', 'status': 'DRAFT'|'ACTIVE'|'INACTIVE' }
Response Structure
(dict) --
detectorId (string) --
The ID for the created version's parent detector.
detectorVersionId (string) --
The ID for the created detector.
status (string) --
The status of the detector version.
{'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}
Creates a model using the specified model type.
See also: AWS API Documentation
Request Syntax
client.create_model( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', description='string', eventTypeName='string', tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The model ID.
string
[REQUIRED]
The model type.
string
The model description.
string
[REQUIRED]
The name of the event type.
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
(dict) --
{'ingestedEventsDetail': {'ingestedEventsTimeWindow': {'endTime': 'string', 'startTime': 'string'}}, 'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}, 'trainingDataSchema': {'labelSchema': {'unlabeledEventsTreatment': 'IGNORE | ' 'FRAUD | ' 'LEGIT'}}, 'trainingDataSource': {'INGESTED_EVENTS'}}Response
{'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}
Creates a version of the model using the specified model type and model id.
See also: AWS API Documentation
Request Syntax
client.create_model_version( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', trainingDataSource='EXTERNAL_EVENTS'|'INGESTED_EVENTS', trainingDataSchema={ 'modelVariables': [ 'string', ], 'labelSchema': { 'labelMapper': { 'string': [ 'string', ] }, 'unlabeledEventsTreatment': 'IGNORE'|'FRAUD'|'LEGIT' } }, externalEventsDetail={ 'dataLocation': 'string', 'dataAccessRoleArn': 'string' }, ingestedEventsDetail={ 'ingestedEventsTimeWindow': { 'startTime': 'string', 'endTime': 'string' } }, tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The model ID.
string
[REQUIRED]
The model type.
string
[REQUIRED]
The training data source location in Amazon S3.
dict
[REQUIRED]
The training data schema.
modelVariables (list) -- [REQUIRED]
The training data schema variables.
(string) --
labelSchema (dict) -- [REQUIRED]
The label schema.
labelMapper (dict) -- [REQUIRED]
The label mapper maps the Amazon Fraud Detector supported model classification labels (FRAUD , LEGIT ) to the appropriate event type labels. For example, if "FRAUD " and "LEGIT " are Amazon Fraud Detector supported labels, this mapper could be: {"FRAUD" => ["0"] , "LEGIT" => ["1"]} or {"FRAUD" => ["false"] , "LEGIT" => ["true"]} or {"FRAUD" => ["fraud", "abuse"] , "LEGIT" => ["legit", "safe"]} . The value part of the mapper is a list, because you may have multiple label variants from your event type for a single Amazon Fraud Detector label.
(string) --
(list) --
(string) --
unlabeledEventsTreatment (string) --
The action to take for unlabeled events.
dict
Details of the external events data used for model version training. Required if trainingDataSource is EXTERNAL_EVENTS .
dataLocation (string) -- [REQUIRED]
The Amazon S3 bucket location for the data.
dataAccessRoleArn (string) -- [REQUIRED]
The ARN of the role that provides Amazon Fraud Detector access to the data location.
dict
Details of the ingested events data used for model version training. Required if trainingDataSource is INGESTED_EVENTS .
ingestedEventsTimeWindow (dict) -- [REQUIRED]
The start and stop time of the ingested events.
startTime (string) -- [REQUIRED]
Timestamp of the first ingensted event.
endTime (string) -- [REQUIRED]
Timestamp of the final ingested event.
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
Response Syntax
{ 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', 'modelVersionNumber': 'string', 'status': 'string' }
Response Structure
(dict) --
modelId (string) --
The model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number of the model version created.
status (string) --
The model version status.
{'deleteAuditHistory': 'boolean'}
Deletes the specified event.
When you delete an event, Amazon Fraud Detector permanently deletes that event and the event data is no longer stored in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
client.delete_event( eventId='string', eventTypeName='string', deleteAuditHistory=True|False )
string
[REQUIRED]
The ID of the event to delete.
string
[REQUIRED]
The name of the event type.
boolean
Specifies whether or not to delete any predictions associated with the event.
dict
Response Syntax
{}
Response Structure
(dict) --
{'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}
Deletes a model.
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, Amazon Fraud Detector permanently deletes that model and the data is no longer stored in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
client.delete_model( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS' )
string
[REQUIRED]
The model ID of the model to delete.
string
[REQUIRED]
The model type of the model to delete.
dict
Response Syntax
{}
Response Structure
(dict) --
{'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}
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.
See also: AWS API Documentation
Request Syntax
client.delete_model_version( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', modelVersionNumber='string' )
string
[REQUIRED]
The model ID of the model version to delete.
string
[REQUIRED]
The model type of the model version to delete.
string
[REQUIRED]
The model version number of the model version to delete.
dict
Response Syntax
{}
Response Structure
(dict) --
{'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}Response
{'modelVersionDetails': {'ingestedEventsDetail': {'ingestedEventsTimeWindow': {'endTime': 'string', 'startTime': 'string'}}, 'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}, 'trainingDataSchema': {'labelSchema': {'unlabeledEventsTreatment': 'IGNORE ' '| ' 'FRAUD ' '| ' 'LEGIT'}}, 'trainingDataSource': {'INGESTED_EVENTS'}}}
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.
See also: AWS API Documentation
Request Syntax
client.describe_model_versions( modelId='string', modelVersionNumber='string', modelType='ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', nextToken='string', maxResults=123 )
string
The model ID.
string
The model version number.
string
The model type.
string
The next token from the previous results.
integer
The maximum number of results to return.
dict
Response Syntax
{ 'modelVersionDetails': [ { 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', 'modelVersionNumber': 'string', 'status': 'string', 'trainingDataSource': 'EXTERNAL_EVENTS'|'INGESTED_EVENTS', 'trainingDataSchema': { 'modelVariables': [ 'string', ], 'labelSchema': { 'labelMapper': { 'string': [ 'string', ] }, 'unlabeledEventsTreatment': 'IGNORE'|'FRAUD'|'LEGIT' } }, 'externalEventsDetail': { 'dataLocation': 'string', 'dataAccessRoleArn': 'string' }, 'ingestedEventsDetail': { 'ingestedEventsTimeWindow': { 'startTime': 'string', 'endTime': 'string' } }, 'trainingResult': { 'dataValidationMetrics': { 'fileLevelMessages': [ { 'title': 'string', 'content': 'string', 'type': 'string' }, ], 'fieldLevelMessages': [ { 'fieldName': 'string', 'identifier': 'string', 'title': 'string', 'content': 'string', 'type': 'string' }, ] }, 'trainingMetrics': { 'auc': ..., 'metricDataPoints': [ { 'fpr': ..., 'precision': ..., 'tpr': ..., 'threshold': ... }, ] }, 'variableImportanceMetrics': { 'logOddsMetrics': [ { 'variableName': 'string', 'variableType': 'string', 'variableImportance': ... }, ] } }, 'lastUpdatedTime': 'string', 'createdTime': 'string', 'arn': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
modelVersionDetails (list) --
The model version details.
(dict) --
The details of the model version.
modelId (string) --
The model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number.
status (string) --
The status of the model version.
trainingDataSource (string) --
The model version training data source.
trainingDataSchema (dict) --
The training data schema.
modelVariables (list) --
The training data schema variables.
(string) --
labelSchema (dict) --
The label schema.
labelMapper (dict) --
The label mapper maps the Amazon Fraud Detector supported model classification labels (FRAUD , LEGIT ) to the appropriate event type labels. For example, if "FRAUD " and "LEGIT " are Amazon Fraud Detector supported labels, this mapper could be: {"FRAUD" => ["0"] , "LEGIT" => ["1"]} or {"FRAUD" => ["false"] , "LEGIT" => ["true"]} or {"FRAUD" => ["fraud", "abuse"] , "LEGIT" => ["legit", "safe"]} . The value part of the mapper is a list, because you may have multiple label variants from your event type for a single Amazon Fraud Detector label.
(string) --
(list) --
(string) --
unlabeledEventsTreatment (string) --
The action to take for unlabeled events.
externalEventsDetail (dict) --
The external events data details. This will be populated if the trainingDataSource for the model version is specified as EXTERNAL_EVENTS .
dataLocation (string) --
The Amazon S3 bucket location for the data.
dataAccessRoleArn (string) --
The ARN of the role that provides Amazon Fraud Detector access to the data location.
ingestedEventsDetail (dict) --
The ingested events data details. This will be populated if the trainingDataSource for the model version is specified as INGESTED_EVENTS .
ingestedEventsTimeWindow (dict) --
The start and stop time of the ingested events.
startTime (string) --
Timestamp of the first ingensted event.
endTime (string) --
Timestamp of the final ingested event.
trainingResult (dict) --
The training results.
dataValidationMetrics (dict) --
The validation metrics.
fileLevelMessages (list) --
The file-specific model training validation messages.
(dict) --
The message details.
title (string) --
The message title.
content (string) --
The message content.
type (string) --
The message type.
fieldLevelMessages (list) --
The field-specific model training validation messages.
(dict) --
The message details.
fieldName (string) --
The field name.
identifier (string) --
The message ID.
title (string) --
The message title.
content (string) --
The message content.
type (string) --
The message type.
trainingMetrics (dict) --
The training metric details.
auc (float) --
The area under the curve. This summarizes true positive rate (TPR) and false positive rate (FPR) across all possible model score thresholds. A model with no predictive power has an AUC of 0.5, whereas a perfect model has a score of 1.0.
metricDataPoints (list) --
The data points details.
(dict) --
Model performance metrics data points.
fpr (float) --
The false positive rate. This is the percentage of total legitimate events that are incorrectly predicted as fraud.
precision (float) --
The percentage of fraud events correctly predicted as fraudulent as compared to all events predicted as fraudulent.
tpr (float) --
The true positive rate. This is the percentage of total fraud the model detects. Also known as capture rate.
threshold (float) --
The model threshold that specifies an acceptable fraud capture rate. For example, a threshold of 500 means any model score 500 or above is labeled as fraud.
variableImportanceMetrics (dict) --
The variable importance metrics.
logOddsMetrics (list) --
List of variable metrics.
(dict) --
The log odds metric details.
variableName (string) --
The name of the variable.
variableType (string) --
The type of variable.
variableImportance (float) --
The relative importance of the variable. For more information, see Model variable importance .
lastUpdatedTime (string) --
The timestamp when the model was last updated.
createdTime (string) --
The timestamp when the model was created.
arn (string) --
The model version ARN.
nextToken (string) --
The next token.
{'modelVersions': {'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}}
Gets a particular detector version.
See also: AWS API Documentation
Request Syntax
client.get_detector_version( detectorId='string', detectorVersionId='string' )
string
[REQUIRED]
The detector ID.
string
[REQUIRED]
The detector version ID.
dict
Response Syntax
{ 'detectorId': 'string', 'detectorVersionId': 'string', 'description': 'string', 'externalModelEndpoints': [ 'string', ], 'modelVersions': [ { 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', 'modelVersionNumber': 'string', 'arn': 'string' }, ], 'rules': [ { 'detectorId': 'string', 'ruleId': 'string', 'ruleVersion': 'string' }, ], 'status': 'DRAFT'|'ACTIVE'|'INACTIVE', 'lastUpdatedTime': 'string', 'createdTime': 'string', 'ruleExecutionMode': 'ALL_MATCHED'|'FIRST_MATCHED', 'arn': 'string' }
Response Structure
(dict) --
detectorId (string) --
The detector ID.
detectorVersionId (string) --
The detector version ID.
description (string) --
The detector version description.
externalModelEndpoints (list) --
The Amazon SageMaker model endpoints included in the detector version.
(string) --
modelVersions (list) --
The model versions included in the detector version.
(dict) --
The model version.
modelId (string) --
The model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number.
arn (string) --
The model version ARN.
rules (list) --
The rules included in the detector version.
(dict) --
A rule.
detectorId (string) --
The detector for which the rule is associated.
ruleId (string) --
The rule ID.
ruleVersion (string) --
The rule version.
status (string) --
The status of the detector version.
lastUpdatedTime (string) --
The timestamp when the detector version was last updated.
createdTime (string) --
The timestamp when the detector version was created.
ruleExecutionMode (string) --
The execution mode of the rule in the dectector
FIRST_MATCHED indicates that Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule.
ALL_MATCHED indicates that Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules. You can define and edit the rule mode at the detector version level, when it is in draft status.
arn (string) --
The detector version ARN.
{'modelScores': {'modelVersion': {'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}}}
Evaluates an event against a detector version. If a version ID is not provided, the detector’s (ACTIVE ) version is used.
See also: AWS API Documentation
Request Syntax
client.get_event_prediction( detectorId='string', detectorVersionId='string', eventId='string', eventTypeName='string', entities=[ { 'entityType': 'string', 'entityId': 'string' }, ], eventTimestamp='string', eventVariables={ 'string': 'string' }, externalModelEndpointDataBlobs={ 'string': { 'byteBuffer': b'bytes', 'contentType': 'string' } } )
string
[REQUIRED]
The detector ID.
string
The detector version ID.
string
[REQUIRED]
The unique ID used to identify the event.
string
[REQUIRED]
The event type associated with the detector specified for the prediction.
list
[REQUIRED]
The entity type (associated with the detector's event type) and specific entity ID representing who performed the event. If an entity id is not available, use "UNKNOWN."
(dict) --
The entity details.
entityType (string) -- [REQUIRED]
The entity type.
entityId (string) -- [REQUIRED]
The entity ID. If you do not know the entityId , you can pass unknown , which is areserved string literal.
string
[REQUIRED]
Timestamp that defines when the event under evaluation occurred. The timestamp must be specified using ISO 8601 standard in UTC.
dict
[REQUIRED]
Names of the event type's variables you defined in Amazon Fraud Detector to represent data elements and their corresponding values for the event you are sending for evaluation.
Warning
You must provide at least one eventVariable
To ensure most accurate fraud prediction and to simplify your data preparation, Amazon Fraud Detector will replace all missing variables or values as follows:
For Amazon Fraud Detector trained models:
If a null value is provided explicitly for a variable or if a variable is missing, model will replace the null value or the missing variable (no variable name in the eventVariables map) with calculated default mean/medians for numeric variables and with special values for categorical variables.
For imported SageMaker models:
If a null value is provided explicitly for a variable, the model and rules will use “null” as the value. If a variable is not provided (no variable name in the eventVariables map), model and rules will use the default value that is provided for the variable.
(string) --
(string) --
dict
The Amazon SageMaker model endpoint input data blobs.
(string) --
(dict) --
A pre-formed Amazon SageMaker model input you can include if your detector version includes an imported Amazon SageMaker model endpoint with pass-through input configuration.
byteBuffer (bytes) --
The byte buffer of the Amazon SageMaker model endpoint input data blob.
contentType (string) --
The content type of the Amazon SageMaker model endpoint input data blob.
dict
Response Syntax
{ 'modelScores': [ { 'modelVersion': { 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', 'modelVersionNumber': 'string', 'arn': 'string' }, 'scores': { 'string': ... } }, ], 'ruleResults': [ { 'ruleId': 'string', 'outcomes': [ 'string', ] }, ], 'externalModelOutputs': [ { 'externalModel': { 'modelEndpoint': 'string', 'modelSource': 'SAGEMAKER' }, 'outputs': { 'string': 'string' } }, ] }
Response Structure
(dict) --
modelScores (list) --
The model scores. Amazon Fraud Detector generates model scores between 0 and 1000, where 0 is low fraud risk and 1000 is high fraud risk. Model scores are directly related to the false positive rate (FPR). For example, a score of 600 corresponds to an estimated 10% false positive rate whereas a score of 900 corresponds to an estimated 2% false positive rate.
(dict) --
The fraud prediction scores.
modelVersion (dict) --
The model version.
modelId (string) --
The model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number.
arn (string) --
The model version ARN.
scores (dict) --
The model's fraud prediction scores.
(string) --
(float) --
ruleResults (list) --
The results from the rules.
(dict) --
The rule results.
ruleId (string) --
The rule ID that was matched, based on the rule execution mode.
outcomes (list) --
The outcomes of the matched rule, based on the rule execution mode.
(string) --
externalModelOutputs (list) --
The model scores for Amazon SageMaker models.
(dict) --
The fraud prediction scores from Amazon SageMaker model.
externalModel (dict) --
The Amazon SageMaker model.
modelEndpoint (string) --
The endpoint of the Amazon SageMaker model.
modelSource (string) --
The source of the model.
outputs (dict) --
The fraud prediction scores from Amazon SageMaker model.
(string) --
(string) --
{'eventTypes': {'eventIngestion': 'ENABLED | DISABLED', 'ingestedEventStatistics': {'eventDataSizeInBytes': 'long', 'lastUpdatedTime': 'string', 'leastRecentEvent': 'string', 'mostRecentEvent': 'string', 'numberOfEvents': 'long'}}}
Gets all event types or a specific event type if name is provided. This is a paginated API. If you provide a null maxResults , this action retrieves a maximum of 10 records per page. If you provide a maxResults , the value must be between 5 and 10. To get the next page results, provide the pagination token from the GetEventTypesResponse as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
client.get_event_types( name='string', nextToken='string', maxResults=123 )
string
The name.
string
The next token for the subsequent request.
integer
The maximum number of objects to return for the request.
dict
Response Syntax
{ 'eventTypes': [ { 'name': 'string', 'description': 'string', 'eventVariables': [ 'string', ], 'labels': [ 'string', ], 'entityTypes': [ 'string', ], 'eventIngestion': 'ENABLED'|'DISABLED', 'ingestedEventStatistics': { 'numberOfEvents': 123, 'eventDataSizeInBytes': 123, 'leastRecentEvent': 'string', 'mostRecentEvent': 'string', 'lastUpdatedTime': 'string' }, 'lastUpdatedTime': 'string', 'createdTime': 'string', 'arn': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
eventTypes (list) --
An array of event types.
(dict) --
The event type details.
name (string) --
The event type name.
description (string) --
The event type description.
eventVariables (list) --
The event type event variables.
(string) --
labels (list) --
The event type labels.
(string) --
entityTypes (list) --
The event type entity types.
(string) --
eventIngestion (string) --
If Enabled , Amazon Fraud Detector stores event data when you generate a prediction and uses that data to update calculated variables in near real-time. Amazon Fraud Detector uses this data, known as INGESTED_EVENTS , to train your model and improve fraud predictions.
ingestedEventStatistics (dict) --
Data about the stored events.
numberOfEvents (integer) --
The number of stored events.
eventDataSizeInBytes (integer) --
The total size of the stored events.
leastRecentEvent (string) --
The oldest stored event.
mostRecentEvent (string) --
The newest stored event.
lastUpdatedTime (string) --
Timestamp of when the stored event was last updated.
lastUpdatedTime (string) --
Timestamp of when the event type was last updated.
createdTime (string) --
Timestamp of when the event type was created.
arn (string) --
The entity type ARN.
nextToken (string) --
The next page token.
{'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}Response
{'ingestedEventsDetail': {'ingestedEventsTimeWindow': {'endTime': 'string', 'startTime': 'string'}}, 'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}, 'trainingDataSchema': {'labelSchema': {'unlabeledEventsTreatment': 'IGNORE | ' 'FRAUD | ' 'LEGIT'}}, 'trainingDataSource': {'INGESTED_EVENTS'}}
Gets the details of the specified model version.
See also: AWS API Documentation
Request Syntax
client.get_model_version( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', modelVersionNumber='string' )
string
[REQUIRED]
The model ID.
string
[REQUIRED]
The model type.
string
[REQUIRED]
The model version number.
dict
Response Syntax
{ 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', 'modelVersionNumber': 'string', 'trainingDataSource': 'EXTERNAL_EVENTS'|'INGESTED_EVENTS', 'trainingDataSchema': { 'modelVariables': [ 'string', ], 'labelSchema': { 'labelMapper': { 'string': [ 'string', ] }, 'unlabeledEventsTreatment': 'IGNORE'|'FRAUD'|'LEGIT' } }, 'externalEventsDetail': { 'dataLocation': 'string', 'dataAccessRoleArn': 'string' }, 'ingestedEventsDetail': { 'ingestedEventsTimeWindow': { 'startTime': 'string', 'endTime': 'string' } }, 'status': 'string', 'arn': 'string' }
Response Structure
(dict) --
modelId (string) --
The model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number.
trainingDataSource (string) --
The training data source.
trainingDataSchema (dict) --
The training data schema.
modelVariables (list) --
The training data schema variables.
(string) --
labelSchema (dict) --
The label schema.
labelMapper (dict) --
The label mapper maps the Amazon Fraud Detector supported model classification labels (FRAUD , LEGIT ) to the appropriate event type labels. For example, if "FRAUD " and "LEGIT " are Amazon Fraud Detector supported labels, this mapper could be: {"FRAUD" => ["0"] , "LEGIT" => ["1"]} or {"FRAUD" => ["false"] , "LEGIT" => ["true"]} or {"FRAUD" => ["fraud", "abuse"] , "LEGIT" => ["legit", "safe"]} . The value part of the mapper is a list, because you may have multiple label variants from your event type for a single Amazon Fraud Detector label.
(string) --
(list) --
(string) --
unlabeledEventsTreatment (string) --
The action to take for unlabeled events.
externalEventsDetail (dict) --
The details of the external events data used for training the model version. This will be populated if the trainingDataSource is EXTERNAL_EVENTS
dataLocation (string) --
The Amazon S3 bucket location for the data.
dataAccessRoleArn (string) --
The ARN of the role that provides Amazon Fraud Detector access to the data location.
ingestedEventsDetail (dict) --
The details of the ingested events data used for training the model version. This will be populated if the trainingDataSource is INGESTED_EVENTS .
ingestedEventsTimeWindow (dict) --
The start and stop time of the ingested events.
startTime (string) --
Timestamp of the first ingensted event.
endTime (string) --
Timestamp of the final ingested event.
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
arn (string) --
The model version ARN.
{'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}Response
{'models': {'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}}
Gets one or more models. Gets all models for the Amazon Web Services account if no model type and no model id provided. Gets all models for the Amazon Web Services account and model type, if the model type is specified but model id is not provided. Gets a specific model if (model type, model id) tuple is specified.
This is a paginated API. If you provide a null maxResults , this action retrieves a maximum of 10 records per page. If you provide a maxResults , the value must be between 1 and 10. To get the next page results, provide the pagination token from the response as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
client.get_models( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', nextToken='string', maxResults=123 )
string
The model ID.
string
The model type.
string
The next token for the subsequent request.
integer
The maximum number of objects to return for the request.
dict
Response Syntax
{ 'nextToken': 'string', 'models': [ { 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', 'description': 'string', 'eventTypeName': 'string', 'createdTime': 'string', 'lastUpdatedTime': 'string', 'arn': 'string' }, ] }
Response Structure
(dict) --
nextToken (string) --
The next page token to be used in subsequent requests.
models (list) --
The array of models.
(dict) --
The model.
modelId (string) --
The model ID.
modelType (string) --
The model type.
description (string) --
The model description.
eventTypeName (string) --
The name of the event type.
createdTime (string) --
Timestamp of when the model was created.
lastUpdatedTime (string) --
Timestamp of last time the model was updated.
arn (string) --
The ARN of the model.
{'eventIngestion': 'ENABLED | DISABLED'}
Creates or updates an event type. An event is a business activity that is evaluated for fraud risk. With Amazon Fraud Detector, you generate fraud predictions for events. An event type defines the structure for an event sent to Amazon Fraud Detector. This includes the variables sent as part of the event, the entity performing the event (such as a customer), and the labels that classify the event. Example event types include online payment transactions, account registrations, and authentications.
See also: AWS API Documentation
Request Syntax
client.put_event_type( name='string', description='string', eventVariables=[ 'string', ], labels=[ 'string', ], entityTypes=[ 'string', ], eventIngestion='ENABLED'|'DISABLED', tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The name.
string
The description of the event type.
list
[REQUIRED]
The event type variables.
(string) --
list
The event type labels.
(string) --
list
[REQUIRED]
The entity type for the event type. Example entity types: customer, merchant, account.
(string) --
string
Specifies if ingenstion is enabled or disabled.
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
(dict) --
{'modelVersions': {'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}}
Updates a detector version. The detector version attributes that you can update include models, external model endpoints, rules, rule execution mode, and description. You can only update a DRAFT detector version.
See also: AWS API Documentation
Request Syntax
client.update_detector_version( detectorId='string', detectorVersionId='string', externalModelEndpoints=[ 'string', ], rules=[ { 'detectorId': 'string', 'ruleId': 'string', 'ruleVersion': 'string' }, ], description='string', modelVersions=[ { 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', 'modelVersionNumber': 'string', 'arn': 'string' }, ], ruleExecutionMode='ALL_MATCHED'|'FIRST_MATCHED' )
string
[REQUIRED]
The parent detector ID for the detector version you want to update.
string
[REQUIRED]
The detector version ID.
list
[REQUIRED]
The Amazon SageMaker model endpoints to include in the detector version.
(string) --
list
[REQUIRED]
The rules to include in the detector version.
(dict) --
A rule.
detectorId (string) -- [REQUIRED]
The detector for which the rule is associated.
ruleId (string) -- [REQUIRED]
The rule ID.
ruleVersion (string) -- [REQUIRED]
The rule version.
string
The detector version description.
list
The model versions to include in the detector version.
(dict) --
The model version.
modelId (string) -- [REQUIRED]
The model ID.
modelType (string) -- [REQUIRED]
The model type.
modelVersionNumber (string) -- [REQUIRED]
The model version number.
arn (string) --
The model version ARN.
string
The rule execution mode to add to the detector.
If you specify FIRST_MATCHED , Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule.
If you specifiy ALL_MATCHED , Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules. You can define and edit the rule mode at the detector version level, when it is in draft status.
The default behavior is FIRST_MATCHED .
dict
Response Syntax
{}
Response Structure
(dict) --
{'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}
Updates model description.
See also: AWS API Documentation
Request Syntax
client.update_model( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', description='string' )
string
[REQUIRED]
The model ID.
string
[REQUIRED]
The model type.
string
The new model description.
dict
Response Syntax
{}
Response Structure
(dict) --
{'ingestedEventsDetail': {'ingestedEventsTimeWindow': {'endTime': 'string', 'startTime': 'string'}}, 'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}Response
{'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}
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.
See also: AWS API Documentation
Request Syntax
client.update_model_version( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', majorVersionNumber='string', externalEventsDetail={ 'dataLocation': 'string', 'dataAccessRoleArn': 'string' }, ingestedEventsDetail={ 'ingestedEventsTimeWindow': { 'startTime': 'string', 'endTime': 'string' } }, tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The model ID.
string
[REQUIRED]
The model type.
string
[REQUIRED]
The major version number.
dict
The details of the external events data used for training the model version. Required if trainingDataSource is EXTERNAL_EVENTS .
dataLocation (string) -- [REQUIRED]
The Amazon S3 bucket location for the data.
dataAccessRoleArn (string) -- [REQUIRED]
The ARN of the role that provides Amazon Fraud Detector access to the data location.
dict
The details of the ingested event used for training the model version. Required if your trainingDataSource is INGESTED_EVENTS .
ingestedEventsTimeWindow (dict) -- [REQUIRED]
The start and stop time of the ingested events.
startTime (string) -- [REQUIRED]
Timestamp of the first ingensted event.
endTime (string) -- [REQUIRED]
Timestamp of the final ingested event.
list
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) -- [REQUIRED]
A tag key.
value (string) -- [REQUIRED]
A value assigned to a tag key.
dict
Response Syntax
{ 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', 'modelVersionNumber': 'string', 'status': 'string' }
Response Structure
(dict) --
modelId (string) --
The model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number of the model version updated.
status (string) --
The status of the updated model version.
{'modelType': {'TRANSACTION_FRAUD_INSIGHTS'}}
Updates the status of a model version.
You can perform the following status updates:
Change the TRAINING_COMPLETE status to ACTIVE .
Change ACTIVE to INACTIVE .
See also: AWS API Documentation
Request Syntax
client.update_model_version_status( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS', modelVersionNumber='string', status='ACTIVE'|'INACTIVE'|'TRAINING_CANCELLED' )
string
[REQUIRED]
The model ID of the model version to update.
string
[REQUIRED]
The model type.
string
[REQUIRED]
The model version number.
string
[REQUIRED]
The model version status.
dict
Response Syntax
{}
Response Structure
(dict) --