GetEventPrediction - Amazon Fraud Detector

GetEventPrediction

Evaluates an event against a detector version. If a version ID is not provided, the detector’s (ACTIVE) version is used.

Request Syntax

{ "detectorId": "string", "detectorVersionId": "string", "entities": [ { "entityId": "string", "entityType": "string" } ], "eventId": "string", "eventTimestamp": "string", "eventTypeName": "string", "eventVariables": { "string" : "string" }, "externalModelEndpointDataBlobs": { "string" : { "byteBuffer": blob, "contentType": "string" } } }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

detectorId

The detector ID.

Type: String

Required: Yes

detectorVersionId

The detector version ID.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 5.

Pattern: ^([1-9][0-9]*)$

Required: No

entities

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."

Type: Array of Entity objects

Required: Yes

eventId

The unique ID used to identify the event.

Type: String

Required: Yes

eventTimestamp

Timestamp that defines when the event under evaluation occurred.

Type: String

Required: Yes

eventTypeName

The event type associated with the detector specified for the prediction.

Type: String

Required: Yes

eventVariables

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.

Type: String to string map

Map Entries: Maximum number of items.

Key Length Constraints: Minimum length of 1. Maximum length of 64.

Value Length Constraints: Minimum length of 1. Maximum length of 1024.

Required: Yes

externalModelEndpointDataBlobs

The Amazon SageMaker model endpoint input data blobs.

Type: String to ModelEndpointDataBlob object map

Required: No

Response Syntax

{ "modelScores": [ { "modelVersion": { "arn": "string", "modelId": "string", "modelType": "string", "modelVersionNumber": "string" }, "scores": { "string" : number } } ], "ruleResults": [ { "outcomes": [ "string" ], "ruleId": "string" } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

modelScores

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.

Type: Array of ModelScores objects

ruleResults

The results.

Type: Array of RuleResult objects

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as PutExternalModel, that specifies a role that is not in your account.

HTTP Status Code: 400

ConflictException

An exception indicating there was a conflict during a delete operation. The following delete operations can cause a conflict exception:

  • DeleteDetector: A conflict exception will occur if the detector has associated Rules or DetectorVersions. You can only delete a detector if it has no Rules or DetectorVersions.

  • DeleteDetectorVersion: A conflict exception will occur if the DetectorVersion status is ACTIVE.

  • DeleteRule: A conflict exception will occur if the RuleVersion is in use by an associated ACTIVE or INACTIVE DetectorVersion.

HTTP Status Code: 400

InternalServerException

An exception indicating an internal server error.

HTTP Status Code: 500

ResourceNotFoundException

An exception indicating the specified resource was not found.

HTTP Status Code: 400

ThrottlingException

An exception indicating a throttling error.

HTTP Status Code: 400

ValidationException

An exception indicating a specified value is not allowed.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: