Step 6: Test and get predictions - Amazon Fraud Detector

Step 6: Test and get predictions

In the Amazon Fraud Detector console, you can test your detector’s logic using mock event data with the Run test feature.

  1. Scroll to Run test at the bottom of the Detector version details page.

  2. For Event metadata, enter a timestamp of when the event occurred, as well as a unique identifier for the entity performing the event. For this exercise, select a date from the date picker for timestamp, and enter “1234” for the Entity ID.

  3. For Event variable, enter the variable values that you would like to test. For this exercise, you only need two input fields (that is, ip_address and email_address) because these are the inputs used to train your Amazon Fraud Detector model. You can use the following example values (assuming you used the suggested variable names):

    • ip_address:

    • email_address:

  4. Choose Run test.

  5. Amazon Fraud Detector returns the fraud prediction outcome based on the rule execution mode. If the rule execution mode is FIRST_MATCHED, then the returned outcome corresponds to the first rule (the highest priority) that matched (evaluated to true). If the rule execution mode is ALL_MATCHED, then the returned outcome corresponds to all rules that matched (evaluated to be true). Amazon Fraud Detector also returns the model score for any models added to your detector.

  6. When you are satisfied that the detector is working as expected, you can promote it from Draft to Active, which makes the detector available for use in real-time fraud detection.

    On the Detector version details page, choose Actions, Publish, Publish version. This changes the detector’s status from Draft to Active.

    At this point, your model and associated detector logic are ready to evaluate online activities for fraud in real-time using the Amazon Fraud Detector GetEventPrediction API. Alternatively, you can evaluate events offline, using a CSV input file and the CreateBatchPredictionJob API. For a code sample, see Get fraud predictions.