FraudDetector / Client / create_model_version
create_model_version#
- FraudDetector.Client.create_model_version(**kwargs)#
- Creates a version of the model using the specified model type and model id. - See also: AWS API Documentation - Request Syntax- response = client.create_model_version( modelId='string', modelType='ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS'|'ACCOUNT_TAKEOVER_INSIGHTS', trainingDataSource='EXTERNAL_EVENTS'|'INGESTED_EVENTS', trainingDataSchema={ 'modelVariables': [ 'string', ], 'labelSchema': { 'labelMapper': { 'string': [ 'string', ] }, 'unlabeledEventsTreatment': 'IGNORE'|'FRAUD'|'LEGIT'|'AUTO' } }, externalEventsDetail={ 'dataLocation': 'string', 'dataAccessRoleArn': 'string' }, ingestedEventsDetail={ 'ingestedEventsTimeWindow': { 'startTime': 'string', 'endTime': 'string' } }, tags=[ { 'key': 'string', 'value': 'string' }, ] ) - Parameters:
- modelId (string) – - [REQUIRED] - The model ID. 
- modelType (string) – - [REQUIRED] - The model type. 
- trainingDataSource (string) – - [REQUIRED] - The training data source location in Amazon S3. 
- trainingDataSchema (dict) – - [REQUIRED] - The training data schema. - modelVariables (list) – [REQUIRED] - 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. - Use - IGNOREif you want the unlabeled events to be ignored. This is recommended when the majority of the events in the dataset are labeled.
- Use - FRAUDif you want to categorize all unlabeled events as “Fraud”. This is recommended when most of the events in your dataset are fraudulent.
- Use - LEGITif you want to categorize all unlabeled events as “Legit”. This is recommended when most of the events in your dataset are legitimate.
- Use - AUTOif you want Amazon Fraud Detector to decide how to use the unlabeled data. This is recommended when there is significant unlabeled events in the dataset.
 - By default, Amazon Fraud Detector ignores the unlabeled data. 
 
 
- externalEventsDetail (dict) – - Details of the external events data used for model version training. Required if - trainingDataSourceis- 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. 
 
- ingestedEventsDetail (dict) – - Details of the ingested events data used for model version training. Required if - trainingDataSourceis- 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. 
 
 
- tags (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. 
 
 
 
- Return type:
- dict 
- Returns:
- Response Syntax- { 'modelId': 'string', 'modelType': 'ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS'|'ACCOUNT_TAKEOVER_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. 
 
 
 - Exceptions- FraudDetector.Client.exceptions.ValidationException
- FraudDetector.Client.exceptions.ResourceNotFoundException
- FraudDetector.Client.exceptions.AccessDeniedException
- FraudDetector.Client.exceptions.ThrottlingException
- FraudDetector.Client.exceptions.InternalServerException