• 沒有找到結果。

Deploy the model

在文檔中 Amazon Fraud Detector (頁 11-14)

Get and upload example training data

1. Download the following file, unzip and use one of the sample CSV files that contain fictitious, synthetically generated training data.

Download: Training_Data.zip.

This zip file contains two files of synthetic registrations that you can use to train a model. The dataset registration_data_20K_minimum contains only two variables: ip_address and email_address.

The dataset registration_data_20K_full contains additional variables for each event such as billing_address, phone_number, and user_agent. Both datasets also contains two mandatory fields:

• EVENT_TIMESTAMP – Defines when the event occurred

• EVENT_LABEL – Classifies the event as fraudulent or legitimate 2. Create an Amazon S3 bucket:

a. Sign in to the AWS Management Console and open the Amazon S3 console at https://

console.aws.amazon.com/s3/.

b. Choose Create bucket, and perform the steps to create your bucket. You must choose an AWS region where Amazon Fraud Detector is currently available: US East (N. Virginia), US East (Ohio), US West (Oregon), Europe (Ireland), Asia Pacific (Singapore) or Asia Pacific (Sydney).

For this exercise, the generic name bucket-name is used. You must rename your bucket because Amazon S3 bucket names must be globally unique.

3. Upload a training data file (that is, one of the .csv files listed previously) to your Amazon S3 bucket.

Note the Amazon S3 location of your training file (for example, s3://bucketname/path/to/some/

object.csv) and your role name. For details about formatting your dataset file, see Preparing data (p. 24).

Step 1: Create event to evaluate for fraud

1. Open the AWS Console and sign in to your account. Navigate to Amazon Fraud Detector.

2. In the left navigation pane, choose Events.

3. On the Events type page, choose Create.

4. Enter sample_registration as the event type name.

5. In the Entity drop-down, select Create entity.

6. In Create entity type, enter sample_customer as the entity type name and, optionally, enter a description of the entity type.

7. Choose Create entity.

8. For Event variables, choose Select variables from a training dataset.

9. In IAM role, select Create IAM role. On the Create IAM role page, enter the specific bucket name where you uploaded your training data. Choose Create role.

10. In Data location, enter the path to your training data. Then choose upload. Amazon Fraud Detector will extract the headers from your training dataset.

11. To allow Amazon Fraud Detector to interpret your variables, you must map them to variable types.

Map ip_address to “IP Address” and email_address, to “Email Address”.

12. For Labels, choose Create new labels.

13. In Create label, enter fraud as the label name as this label corresponds to the value that represents fraudulent events in the synthetic dataset.

14. Choose Create label.

15. Create a second label by following the same steps, this time entering legit as the label name as this corresponds to the value that represents legitimate events in the synthetic dataset.

16. Choose Create event type.

Step 2: Define model details

1. On the Models page, choose Add model and then choose Create model.

2. On Step 1 – Define model details, enter sample_fraud_detection_model as the model name and, optionally, enter a description of the model.

3. For Model Type, choose the Online Fraud Insights model.

4. For Event type, choose sample_registration (the event type you created in Step 1).

5. In Historical event data, for IAM role, select the role you created in Step 1.

6. In Training data location, enter the path to your training data.

7. Choose Next.

Step 3: Configure training and train model

1. In Model inputs, leave all checkboxes checked. By default, Amazon Fraud Detector will use all variables from your historical event dataset as model inputs.

Step 4: Review the trained model’s performance

2. In Label classification, for Fraud labels choose fraud as this label corresponds to the value that represents fraudulent events in the synthetic dataset. For Legitimate labels, choose legit as this label corresponds to the value that represents legitimate events in the synthetic dataset.

3. Choose Next.

4. After reviewing, choose Create and train model. Amazon Fraud Detector will:

• Create the model output variable that can be used to write rules

• Create the model

• Begin to train a new version of the model

Model training using the example training data set takes approximately 45 minutes to complete.

Step 4: Review the trained model’s performance

An important step in using Amazon Fraud Detector is to assess the accuracy of your model using model scores and performance metrics.

After model training is complete, Amazon Fraud Detector validates model performance using 15% of your data that was not used to train the model. You can expect your trained Amazon Fraud Detector model to have real-world fraud detection performance that is similar to the validation performance metrics.

To learn more about model scores and model performance metrics, see Model scores (p. 38) and Model performance metrics (p. 39).

Step 5: Deploy the model

After you’ve validated your trained model and are ready to use it in real-time fraud predictions, you can deploy the model.

1. In the Amazon Fraud Detector console’s left navigation pane, choose Models.

2. In the Models page, choose sample_fraud_detection_model, and then choose the specific model version that you want to deploy (for example, version 1.0).

3. On the Model version page, choose Actions and then choose Deploy model version. The model version is now available to add to detectors, which is covered in Part B: Generate real-time fraud predictions (p. 8).

Part B: Generate real-time fraud predictions

In Amazon Fraud Detector, you create and configure detector versions to hold your fraud prediction logic. Fraud prediction logic consists of your deployed model and rules that tell Amazon Fraud Detector how to interpret the data associated with the model. In Part A, you created, trained, and deployed your model. In Part B, you will create a detector version.

To get a fraud prediction for an event, you send metadata about an online event using the

GetEventPrediction API and then synchronously receive a fraud prediction outcome and model score. In Amazon Fraud Detector, you configure fraud prediction logic using these components: event types, models, variables, rules, outcomes, and detectors.

To create your fraud prediction logic in Amazon Fraud Detector, follow the steps in this section.

Topics

在文檔中 Amazon Fraud Detector (頁 11-14)

相關文件