describe_model_versions

describe_model_versions(**kwargs)

Gets all of the model versions for the specified model type or for the specified model type and model ID. You can also get details for a single, specified model version.

See also: AWS API Documentation

Request Syntax

response = client.describe_model_versions(
    modelId='string',
    modelVersionNumber='string',
    modelType='ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS'|'ACCOUNT_TAKEOVER_INSIGHTS',
    nextToken='string',
    maxResults=123
)
Parameters
  • modelId (string) -- The model ID.
  • modelVersionNumber (string) -- The model version number.
  • modelType (string) -- The model type.
  • nextToken (string) -- The next token from the previous results.
  • maxResults (integer) -- The maximum number of results to return.
Return type

dict

Returns

Response Syntax

{
    'modelVersionDetails': [
        {
            'modelId': 'string',
            'modelType': 'ONLINE_FRAUD_INSIGHTS'|'TRANSACTION_FRAUD_INSIGHTS'|'ACCOUNT_TAKEOVER_INSIGHTS',
            'modelVersionNumber': 'string',
            'status': 'string',
            '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'
                }
            },
            'trainingResult': {
                'dataValidationMetrics': {
                    'fileLevelMessages': [
                        {
                            'title': 'string',
                            'content': 'string',
                            'type': 'string'
                        },
                    ],
                    'fieldLevelMessages': [
                        {
                            'fieldName': 'string',
                            'identifier': 'string',
                            'title': 'string',
                            'content': 'string',
                            'type': 'string'
                        },
                    ]
                },
                'trainingMetrics': {
                    'auc': ...,
                    'metricDataPoints': [
                        {
                            'fpr': ...,
                            'precision': ...,
                            'tpr': ...,
                            'threshold': ...
                        },
                    ]
                },
                'variableImportanceMetrics': {
                    'logOddsMetrics': [
                        {
                            'variableName': 'string',
                            'variableType': 'string',
                            'variableImportance': ...
                        },
                    ]
                }
            },
            'lastUpdatedTime': 'string',
            'createdTime': 'string',
            'arn': 'string',
            'trainingResultV2': {
                'dataValidationMetrics': {
                    'fileLevelMessages': [
                        {
                            'title': 'string',
                            'content': 'string',
                            'type': 'string'
                        },
                    ],
                    'fieldLevelMessages': [
                        {
                            'fieldName': 'string',
                            'identifier': 'string',
                            'title': 'string',
                            'content': 'string',
                            'type': 'string'
                        },
                    ]
                },
                'trainingMetricsV2': {
                    'ofi': {
                        'metricDataPoints': [
                            {
                                'fpr': ...,
                                'precision': ...,
                                'tpr': ...,
                                'threshold': ...
                            },
                        ],
                        'modelPerformance': {
                            'auc': ...,
                            'uncertaintyRange': {
                                'lowerBoundValue': ...,
                                'upperBoundValue': ...
                            }
                        }
                    },
                    'tfi': {
                        'metricDataPoints': [
                            {
                                'fpr': ...,
                                'precision': ...,
                                'tpr': ...,
                                'threshold': ...
                            },
                        ],
                        'modelPerformance': {
                            'auc': ...,
                            'uncertaintyRange': {
                                'lowerBoundValue': ...,
                                'upperBoundValue': ...
                            }
                        }
                    },
                    'ati': {
                        'metricDataPoints': [
                            {
                                'cr': ...,
                                'adr': ...,
                                'threshold': ...,
                                'atodr': ...
                            },
                        ],
                        'modelPerformance': {
                            'asi': ...
                        }
                    }
                },
                'variableImportanceMetrics': {
                    'logOddsMetrics': [
                        {
                            'variableName': 'string',
                            'variableType': 'string',
                            'variableImportance': ...
                        },
                    ]
                },
                'aggregatedVariablesImportanceMetrics': {
                    'logOddsMetrics': [
                        {
                            'variableNames': [
                                'string',
                            ],
                            'aggregatedVariablesImportance': ...
                        },
                    ]
                }
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • modelVersionDetails (list) --

      The model version details.

      • (dict) --

        The details of the model version.

        • modelId (string) --

          The model ID.

        • modelType (string) --

          The model type.

        • modelVersionNumber (string) --

          The model version number.

        • status (string) --

          The status of the model version.

        • trainingDataSource (string) --

          The model version training data source.

        • trainingDataSchema (dict) --

          The training data schema.

          • modelVariables (list) --

            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 IGNORE if you want the unlabeled events to be ignored. This is recommended when the majority of the events in the dataset are labeled.
              • Use FRAUD if you want to categorize all unlabeled events as “Fraud”. This is recommended when most of the events in your dataset are fraudulent.
              • Use LEGIT f you want to categorize all unlabeled events as “Legit”. This is recommended when most of the events in your dataset are legitimate.
              • Use AUTO if 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) --

          The external events data details. This will be populated if the trainingDataSource for the model version is specified as EXTERNAL_EVENTS .

          • dataLocation (string) --

            The Amazon S3 bucket location for the data.

          • dataAccessRoleArn (string) --

            The ARN of the role that provides Amazon Fraud Detector access to the data location.

        • ingestedEventsDetail (dict) --

          The ingested events data details. This will be populated if the trainingDataSource for the model version is specified as INGESTED_EVENTS .

          • ingestedEventsTimeWindow (dict) --

            The start and stop time of the ingested events.

            • startTime (string) --

              Timestamp of the first ingensted event.

            • endTime (string) --

              Timestamp of the final ingested event.

        • trainingResult (dict) --

          The training results.

          • dataValidationMetrics (dict) --

            The validation metrics.

            • fileLevelMessages (list) --

              The file-specific model training data validation messages.

              • (dict) --

                The message details.

                • title (string) --

                  The message title.

                • content (string) --

                  The message content.

                • type (string) --

                  The message type.

            • fieldLevelMessages (list) --

              The field-specific model training validation messages.

              • (dict) --

                The message details.

                • fieldName (string) --

                  The field name.

                • identifier (string) --

                  The message ID.

                • title (string) --

                  The message title.

                • content (string) --

                  The message content.

                • type (string) --

                  The message type.

          • trainingMetrics (dict) --

            The training metric details.

            • auc (float) --

              The area under the curve. This summarizes true positive rate (TPR) and false positive rate (FPR) across all possible model score thresholds. A model with no predictive power has an AUC of 0.5, whereas a perfect model has a score of 1.0.

            • metricDataPoints (list) --

              The data points details.

              • (dict) --

                Model performance metrics data points.

                • fpr (float) --

                  The false positive rate. This is the percentage of total legitimate events that are incorrectly predicted as fraud.

                • precision (float) --

                  The percentage of fraud events correctly predicted as fraudulent as compared to all events predicted as fraudulent.

                • tpr (float) --

                  The true positive rate. This is the percentage of total fraud the model detects. Also known as capture rate.

                • threshold (float) --

                  The model threshold that specifies an acceptable fraud capture rate. For example, a threshold of 500 means any model score 500 or above is labeled as fraud.

          • variableImportanceMetrics (dict) --

            The variable importance metrics.

            • logOddsMetrics (list) --

              List of variable metrics.

              • (dict) --

                The log odds metric details.

                • variableName (string) --

                  The name of the variable.

                • variableType (string) --

                  The type of variable.

                • variableImportance (float) --

                  The relative importance of the variable. For more information, see Model variable importance.

        • lastUpdatedTime (string) --

          The timestamp when the model was last updated.

        • createdTime (string) --

          The timestamp when the model was created.

        • arn (string) --

          The model version ARN.

        • trainingResultV2 (dict) --

          The training result details. The details include the relative importance of the variables.

          • dataValidationMetrics (dict) --

            The model training data validation metrics.

            • fileLevelMessages (list) --

              The file-specific model training data validation messages.

              • (dict) --

                The message details.

                • title (string) --

                  The message title.

                • content (string) --

                  The message content.

                • type (string) --

                  The message type.

            • fieldLevelMessages (list) --

              The field-specific model training validation messages.

              • (dict) --

                The message details.

                • fieldName (string) --

                  The field name.

                • identifier (string) --

                  The message ID.

                • title (string) --

                  The message title.

                • content (string) --

                  The message content.

                • type (string) --

                  The message type.

          • trainingMetricsV2 (dict) --

            The training metric details.

            • ofi (dict) --

              The Online Fraud Insights (OFI) model training metric details.

              • metricDataPoints (list) --

                The model's performance metrics data points.

                • (dict) --

                  The Online Fraud Insights (OFI) model performance metrics data points.

                  • fpr (float) --

                    The false positive rate. This is the percentage of total legitimate events that are incorrectly predicted as fraud.

                  • precision (float) --

                    The percentage of fraud events correctly predicted as fraudulent as compared to all events predicted as fraudulent.

                  • tpr (float) --

                    The true positive rate. This is the percentage of total fraud the model detects. Also known as capture rate.

                  • threshold (float) --

                    The model threshold that specifies an acceptable fraud capture rate. For example, a threshold of 500 means any model score 500 or above is labeled as fraud.

              • modelPerformance (dict) --

                The model's overall performance score.

                • auc (float) --

                  The area under the curve (auc). This summarizes the total positive rate (tpr) and false positive rate (FPR) across all possible model score thresholds.

                • uncertaintyRange (dict) --

                  Indicates the range of area under curve (auc) expected from the OFI model. A range greater than 0.1 indicates higher model uncertainity.

                  • lowerBoundValue (float) --

                    The lower bound value of the area under curve (auc).

                  • upperBoundValue (float) --

                    The lower bound value of the area under curve (auc).

            • tfi (dict) --

              The Transaction Fraud Insights (TFI) model training metric details.

              • metricDataPoints (list) --

                The model's performance metrics data points.

                • (dict) --

                  The performance metrics data points for Transaction Fraud Insights (TFI) model.

                  • fpr (float) --

                    The false positive rate. This is the percentage of total legitimate events that are incorrectly predicted as fraud.

                  • precision (float) --

                    The percentage of fraud events correctly predicted as fraudulent as compared to all events predicted as fraudulent.

                  • tpr (float) --

                    The true positive rate. This is the percentage of total fraud the model detects. Also known as capture rate.

                  • threshold (float) --

                    The model threshold that specifies an acceptable fraud capture rate. For example, a threshold of 500 means any model score 500 or above is labeled as fraud.

              • modelPerformance (dict) --

                The model performance score.

                • auc (float) --

                  The area under the curve (auc). This summarizes the total positive rate (tpr) and false positive rate (FPR) across all possible model score thresholds.

                • uncertaintyRange (dict) --

                  Indicates the range of area under curve (auc) expected from the TFI model. A range greater than 0.1 indicates higher model uncertainity.

                  • lowerBoundValue (float) --

                    The lower bound value of the area under curve (auc).

                  • upperBoundValue (float) --

                    The lower bound value of the area under curve (auc).

            • ati (dict) --

              The Account Takeover Insights (ATI) model training metric details.

              • metricDataPoints (list) --

                The model's performance metrics data points.

                • (dict) --

                  The Account Takeover Insights (ATI) model performance metrics data points.

                  • cr (float) --

                    The challenge rate. This indicates the percentage of login events that the model recommends to challenge such as one-time password, multi-factor authentication, and investigations.

                  • adr (float) --

                    The anomaly discovery rate. This metric quantifies the percentage of anomalies that can be detected by the model at the selected score threshold. A lower score threshold increases the percentage of anomalies captured by the model, but would also require challenging a larger percentage of login events, leading to a higher customer friction.

                  • threshold (float) --

                    The model's threshold that specifies an acceptable fraud capture rate. For example, a threshold of 500 means any model score 500 or above is labeled as fraud.

                  • atodr (float) --

                    The account takeover discovery rate. This metric quantifies the percentage of account compromise events that can be detected by the model at the selected score threshold. This metric is only available if 50 or more entities with at-least one labeled account takeover event is present in the ingested dataset.

              • modelPerformance (dict) --

                The model's overall performance scores.

                • asi (float) --

                  The anomaly separation index (ASI) score. This metric summarizes the overall ability of the model to separate anomalous activities from the normal behavior. Depending on the business, a large fraction of these anomalous activities can be malicious and correspond to the account takeover attacks. A model with no separability power will have the lowest possible ASI score of 0.5, whereas the a model with a high separability power will have the highest possible ASI score of 1.0

          • variableImportanceMetrics (dict) --

            The variable importance metrics details.

            • logOddsMetrics (list) --

              List of variable metrics.

              • (dict) --

                The log odds metric details.

                • variableName (string) --

                  The name of the variable.

                • variableType (string) --

                  The type of variable.

                • variableImportance (float) --

                  The relative importance of the variable. For more information, see Model variable importance.

          • aggregatedVariablesImportanceMetrics (dict) --

            The variable importance metrics of the aggregated variables.

            Account Takeover Insights (ATI) model uses event variables from the login data you provide to continuously calculate a set of variables (aggregated variables) based on historical events. For example, your ATI model might calculate the number of times an user has logged in using the same IP address. In this case, event variables used to derive the aggregated variables are IP address and user .

            • logOddsMetrics (list) --

              List of variables' metrics.

              • (dict) --

                The log odds metric details.

                Account Takeover Insights (ATI) model uses event variables from the login data you provide to continuously calculate a set of variables (aggregated variables) based on historical events. For example, your ATI model might calculate the number of times an user has logged in using the same IP address. In this case, event variables used to derive the aggregated variables are IP address and user .

                • variableNames (list) --

                  The names of all the variables.

                  • (string) --
                • aggregatedVariablesImportance (float) --

                  The relative importance of the variables in the list to the other event variable.

    • nextToken (string) --

      The next token.

Exceptions

  • FraudDetector.Client.exceptions.ValidationException
  • FraudDetector.Client.exceptions.ResourceNotFoundException
  • FraudDetector.Client.exceptions.InternalServerException
  • FraudDetector.Client.exceptions.ThrottlingException
  • FraudDetector.Client.exceptions.AccessDeniedException