{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-fraud-detector/json-schema/amazon-fraud-detector-get-event-prediction-metadata-result-schema.json",
  "title": "GetEventPredictionMetadataResult",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-fraud-detector-operations-api-openapi.yml#/components/schemas/GetEventPredictionMetadataResult",
  "type": "object",
  "properties": {
    "eventId": {
      "type": "string",
      "description": "The event ID."
    },
    "eventTypeName": {
      "type": "string",
      "description": "The event type associated with the detector specified for this prediction."
    },
    "entityId": {
      "type": "string",
      "description": "The entity ID."
    },
    "entityType": {
      "type": "string",
      "description": "The entity type."
    },
    "eventTimestamp": {
      "type": "string",
      "description": "The timestamp for when the prediction was generated for the associated event ID."
    },
    "detectorId": {
      "type": "string",
      "description": "The detector ID."
    },
    "detectorVersionId": {
      "type": "string",
      "description": "The detector version ID."
    },
    "detectorVersionStatus": {
      "type": "string",
      "description": "The status of the detector version."
    },
    "eventVariables": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EventVariableSummary"
      },
      "description": "A list of event variables that influenced the prediction scores."
    },
    "rules": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EvaluatedRule"
      },
      "description": "List of rules associated with the detector version that were used for evaluating variable values."
    },
    "ruleExecutionMode": {
      "type": "string",
      "enum": [
        "ALL_MATCHED",
        "FIRST_MATCHED"
      ],
      "description": "The execution mode of the rule used for evaluating variable values."
    },
    "outcomes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The outcomes of the matched rule, based on the rule execution mode."
    },
    "evaluatedModelVersions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EvaluatedModelVersion"
      },
      "description": "Model versions that were evaluated for generating predictions."
    },
    "evaluatedExternalModels": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EvaluatedExternalModel"
      },
      "description": "External (Amazon SageMaker) models that were evaluated for generating predictions."
    },
    "predictionTimestamp": {
      "type": "string",
      "description": "The timestamp that defines when the prediction was generated."
    }
  },
  "$defs": {
    "AggregatedVariablesImpactExplanation": {
      "type": "object",
      "properties": {
        "eventVariableNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The names of all the event variables that were used to derive the aggregated variables."
        },
        "relativeImpact": {
          "type": "string",
          "description": "The relative impact of the aggregated variables in terms of magnitude on the prediction scores."
        },
        "logOddsImpact": {
          "type": "number",
          "description": "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."
        }
      }
    },
    "EvaluatedExternalModel": {
      "type": "object",
      "properties": {
        "modelEndpoint": {
          "type": "string",
          "description": "The endpoint of the external (Amazon Sagemaker) model."
        },
        "useEventVariables": {
          "type": "boolean",
          "description": "Indicates whether event variables were used to generate predictions."
        },
        "inputVariables": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Input variables use for generating predictions."
        },
        "outputVariables": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Output variables."
        }
      }
    },
    "EvaluatedModelVersion": {
      "type": "object",
      "properties": {
        "modelId": {
          "type": "string",
          "description": "The model ID."
        },
        "modelVersion": {
          "type": "string",
          "description": "The model version."
        },
        "modelType": {
          "type": "string",
          "description": "The model type. Valid values: ONLINE_FRAUD_INSIGHTS | TRANSACTION_FRAUD_INSIGHTS"
        },
        "evaluations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ModelVersionEvaluation"
          },
          "description": "Evaluations generated for the model version."
        }
      }
    },
    "EvaluatedRule": {
      "type": "object",
      "properties": {
        "ruleId": {
          "type": "string",
          "description": "The rule ID."
        },
        "ruleVersion": {
          "type": "string",
          "description": "The rule version."
        },
        "expression": {
          "type": "string",
          "description": "The rule expression."
        },
        "expressionWithValues": {
          "type": "string",
          "description": "The rule expression value."
        },
        "outcomes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The rule outcome."
        },
        "evaluated": {
          "type": "boolean",
          "description": "Indicates whether the rule was evaluated."
        },
        "matched": {
          "type": "boolean",
          "description": "Indicates whether the rule matched."
        }
      }
    },
    "EventVariableSummary": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The event variable name."
        },
        "value": {
          "type": "string",
          "description": "The value of the event variable."
        },
        "source": {
          "type": "string",
          "description": "The event variable source."
        }
      }
    },
    "ModelVersionEvaluation": {
      "type": "object",
      "properties": {
        "outputVariableName": {
          "type": "string",
          "description": "The output variable name."
        },
        "evaluationScore": {
          "type": "string",
          "description": "The evaluation score generated for the model version."
        },
        "predictionExplanations": {
          "$ref": "#/$defs/PredictionExplanations"
        }
      }
    },
    "PredictionExplanations": {
      "type": "object",
      "properties": {
        "variableImpactExplanations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/VariableImpactExplanation"
          },
          "description": "The details of the event variable's impact on the prediction score."
        },
        "aggregatedVariablesImpactExplanations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AggregatedVariablesImpactExplanation"
          },
          "description": "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."
        }
      }
    },
    "VariableImpactExplanation": {
      "type": "object",
      "properties": {
        "eventVariableName": {
          "type": "string",
          "description": "The event variable name."
        },
        "relativeImpact": {
          "type": "string",
          "description": "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": {
          "type": "number",
          "description": "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."
        }
      }
    }
  }
}