FraudDetector / Client / get_event_prediction_metadata

get_event_prediction_metadata#

FraudDetector.Client.get_event_prediction_metadata(**kwargs)#

Gets details of the past fraud predictions for the specified event ID, event type, detector ID, and detector version ID that was generated in the specified time period.

See also: AWS API Documentation

Request Syntax

response = client.get_event_prediction_metadata(
    eventId='string',
    eventTypeName='string',
    detectorId='string',
    detectorVersionId='string',
    predictionTimestamp='string'
)
Parameters:
  • eventId (string) –

    [REQUIRED]

    The event ID.

  • eventTypeName (string) –

    [REQUIRED]

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

  • detectorId (string) –

    [REQUIRED]

    The detector ID.

  • detectorVersionId (string) –

    [REQUIRED]

    The detector version ID.

  • predictionTimestamp (string) –

    [REQUIRED]

    The timestamp that defines when the prediction was generated. The timestamp must be specified using ISO 8601 standard in UTC.

    We recommend calling ListEventPredictions first, and using the predictionTimestamp value in the response to provide an accurate prediction timestamp value.

Return type:

dict

Returns:

Response Syntax

{
    'eventId': 'string',
    'eventTypeName': 'string',
    'entityId': 'string',
    'entityType': 'string',
    'eventTimestamp': 'string',
    'detectorId': 'string',
    'detectorVersionId': 'string',
    'detectorVersionStatus': 'string',
    'eventVariables': [
        {
            'name': 'string',
            'value': 'string',
            'source': 'string'
        },
    ],
    'rules': [
        {
            'ruleId': 'string',
            'ruleVersion': 'string',
            'expression': 'string',
            'expressionWithValues': 'string',
            'outcomes': [
                'string',
            ],
            'evaluated': True|False,
            'matched': True|False
        },
    ],
    'ruleExecutionMode': 'ALL_MATCHED'|'FIRST_MATCHED',
    'outcomes': [
        'string',
    ],
    'evaluatedModelVersions': [
        {
            'modelId': 'string',
            'modelVersion': 'string',
            'modelType': 'string',
            'evaluations': [
                {
                    'outputVariableName': 'string',
                    'evaluationScore': 'string',
                    'predictionExplanations': {
                        'variableImpactExplanations': [
                            {
                                'eventVariableName': 'string',
                                'relativeImpact': 'string',
                                'logOddsImpact': ...
                            },
                        ],
                        'aggregatedVariablesImpactExplanations': [
                            {
                                'eventVariableNames': [
                                    'string',
                                ],
                                'relativeImpact': 'string',
                                'logOddsImpact': ...
                            },
                        ]
                    }
                },
            ]
        },
    ],
    'evaluatedExternalModels': [
        {
            'modelEndpoint': 'string',
            'useEventVariables': True|False,
            'inputVariables': {
                'string': 'string'
            },
            'outputVariables': {
                'string': 'string'
            }
        },
    ],
    'predictionTimestamp': 'string'
}

Response Structure

  • (dict) –

    • eventId (string) –

      The event ID.

    • eventTypeName (string) –

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

    • entityId (string) –

      The entity ID.

    • entityType (string) –

      The entity type.

    • eventTimestamp (string) –

      The timestamp for when the prediction was generated for the associated event ID.

    • detectorId (string) –

      The detector ID.

    • detectorVersionId (string) –

      The detector version ID.

    • detectorVersionStatus (string) –

      The status of the detector version.

    • eventVariables (list) –

      A list of event variables that influenced the prediction scores.

      • (dict) –

        Information about the summary of an event variable that was evaluated for generating prediction.

        • name (string) –

          The event variable name.

        • value (string) –

          The value of the event variable.

        • source (string) –

          The event variable source.

    • rules (list) –

      List of rules associated with the detector version that were used for evaluating variable values.

      • (dict) –

        The details of the rule used for evaluating variable values.

        • ruleId (string) –

          The rule ID.

        • ruleVersion (string) –

          The rule version.

        • expression (string) –

          The rule expression.

        • expressionWithValues (string) –

          The rule expression value.

        • outcomes (list) –

          The rule outcome.

          • (string) –

        • evaluated (boolean) –

          Indicates whether the rule was evaluated.

        • matched (boolean) –

          Indicates whether the rule matched.

    • ruleExecutionMode (string) –

      The execution mode of the rule used for evaluating variable values.

    • outcomes (list) –

      The outcomes of the matched rule, based on the rule execution mode.

      • (string) –

    • evaluatedModelVersions (list) –

      Model versions that were evaluated for generating predictions.

      • (dict) –

        The model version evaluated for generating prediction.

        • modelId (string) –

          The model ID.

        • modelVersion (string) –

          The model version.

        • modelType (string) –

          The model type.

          Valid values: ONLINE_FRAUD_INSIGHTS | TRANSACTION_FRAUD_INSIGHTS

        • evaluations (list) –

          Evaluations generated for the model version.

          • (dict) –

            The model version evalutions.

            • outputVariableName (string) –

              The output variable name.

            • evaluationScore (string) –

              The evaluation score generated for the model version.

            • predictionExplanations (dict) –

              The prediction explanations generated for the model version.

              • variableImpactExplanations (list) –

                The details of the event variable’s impact on the prediction score.

                • (dict) –

                  The details of the event variable’s impact on the prediction score.

                  • eventVariableName (string) –

                    The event variable name.

                  • relativeImpact (string) –

                    The event variable’s relative impact in terms of magnitude on the prediction scores. The relative impact values consist of a numerical rating (0-5, 5 being the highest) and direction (increased/decreased) impact of the fraud risk.

                  • logOddsImpact (float) –

                    The raw, uninterpreted value represented as log-odds of the fraud. These values are usually between -10 to +10, but range from - infinity to + infinity.

                    • A positive value indicates that the variable drove the risk score up.

                    • A negative value indicates that the variable drove the risk score down.

              • aggregatedVariablesImpactExplanations (list) –

                The details of the aggregated variables impact on the prediction score.

                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.

                • (dict) –

                  The details of the impact of aggregated variables on the prediction score.

                  Account Takeover Insights (ATI) model uses the login data you provide to continuously calculate a set of variables (aggregated variables) based on historical events. For example, the 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.

                  • eventVariableNames (list) –

                    The names of all the event variables that were used to derive the aggregated variables.

                    • (string) –

                  • relativeImpact (string) –

                    The relative impact of the aggregated variables in terms of magnitude on the prediction scores.

                  • logOddsImpact (float) –

                    The raw, uninterpreted value represented as log-odds of the fraud. These values are usually between -10 to +10, but range from -infinity to +infinity.

                    • A positive value indicates that the variables drove the risk score up.

                    • A negative value indicates that the variables drove the risk score down.

    • evaluatedExternalModels (list) –

      External (Amazon SageMaker) models that were evaluated for generating predictions.

      • (dict) –

        The details of the external (Amazon Sagemaker) model evaluated for generating predictions.

        • modelEndpoint (string) –

          The endpoint of the external (Amazon Sagemaker) model.

        • useEventVariables (boolean) –

          Indicates whether event variables were used to generate predictions.

        • inputVariables (dict) –

          Input variables use for generating predictions.

          • (string) –

            • (string) –

        • outputVariables (dict) –

          Output variables.

          • (string) –

            • (string) –

    • predictionTimestamp (string) –

      The timestamp that defines when the prediction was generated.

Exceptions

  • FraudDetector.Client.exceptions.ValidationException

  • FraudDetector.Client.exceptions.ResourceNotFoundException

  • FraudDetector.Client.exceptions.AccessDeniedException

  • FraudDetector.Client.exceptions.ThrottlingException

  • FraudDetector.Client.exceptions.InternalServerException