2020/04/17 - Amazon Fraud Detector - 2 new 4 updated api methods
Changes Added support for a new rule engine execution mode. Customers will be able to configure their detector versions to evaluate all rules and return outcomes from all 'matched' rules in the GetPrediction API response. Added support for deleting Detectors (DeleteDetector) and Rule Versions (DeleteRuleVersion).
Deletes the detector. Before deleting a detector, you must first delete all detector versions and rule versions associated with the detector.
See also: AWS API Documentation
Request Syntax
client.delete_detector( detectorId='string' )
string
[REQUIRED]
The ID of the detector to delete.
dict
Response Syntax
{}
Response Structure
(dict) --
Deletes the rule version. You cannot delete a rule version if it is used by an ACTIVE or INACTIVE detector version.
See also: AWS API Documentation
Request Syntax
client.delete_rule_version( detectorId='string', ruleId='string', ruleVersion='string' )
string
[REQUIRED]
The ID of the detector that includes the rule version to delete.
string
[REQUIRED]
The rule ID of the rule version to delete.
string
[REQUIRED]
The rule version to delete.
dict
Response Syntax
{}
Response Structure
(dict) --
{'ruleExecutionMode': 'ALL_MATCHED | FIRST_MATCHED'}
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', 'modelVersionNumber': 'string' }, ], ruleExecutionMode='ALL_MATCHED'|'FIRST_MATCHED' )
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 parent model ID.
modelType (string) -- [REQUIRED]
The model type.
modelVersionNumber (string) -- [REQUIRED]
The model version.
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 .
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.
{'ruleExecutionMode': 'ALL_MATCHED | FIRST_MATCHED'}
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', 'modelVersionNumber': 'string' }, ], 'rules': [ { 'detectorId': 'string', 'ruleId': 'string', 'ruleVersion': 'string' }, ], 'status': 'DRAFT'|'ACTIVE'|'INACTIVE', 'lastUpdatedTime': 'string', 'createdTime': 'string', 'ruleExecutionMode': 'ALL_MATCHED'|'FIRST_MATCHED' }
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 parent model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version.
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.
{'ruleResults': [{'outcomes': ['string'], 'ruleId': 'string'}]}
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_prediction( detectorId='string', detectorVersionId='string', eventId='string', eventAttributes={ '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.
dict
Names of variables you defined in Amazon Fraud Detector to represent event data elements and their corresponding values for the event you are sending for evaluation.
(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
{ 'outcomes': [ 'string', ], 'modelScores': [ { 'modelVersion': { 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS', 'modelVersionNumber': 'string' }, 'scores': { 'string': ... } }, ], 'ruleResults': [ { 'ruleId': 'string', 'outcomes': [ 'string', ] }, ] }
Response Structure
(dict) --
outcomes (list) --
The prediction outcomes.
(string) --
modelScores (list) --
The model scores for models used in the detector version.
(dict) --
The fraud prediction scores.
modelVersion (dict) --
The model version.
modelId (string) --
The parent model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version.
scores (dict) --
The model's fraud prediction scores.
(string) --
(float) --
ruleResults (list) --
The rule results in the prediction.
(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) --
{'ruleExecutionMode': 'ALL_MATCHED | FIRST_MATCHED'}
Updates a detector version. The detector version attributes that you can update include models, external model endpoints, rules, 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', 'modelVersionNumber': '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 parent model ID.
modelType (string) -- [REQUIRED]
The model type.
modelVersionNumber (string) -- [REQUIRED]
The model version.
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) --