Skip to content

A heuristics + ML based risk score engine built to generate a risk score out of 100 on the basis of few weighted predefined transaction rules.

Notifications You must be signed in to change notification settings

prayagupa23/RiskScoreEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Risk Score Heuristics Engine

This project implements a rule-based fraud risk scoring engine for UPI and digital payment transactions.
It evaluates incoming transactions in real time and generates an explainable risk verdict before payment confirmation.


What This Does

  • Builds a transaction context using user behavior and current transaction data
  • Applies heuristic rules to detect suspicious patterns
  • Generates a cumulative risk score (0–100)
  • Classifies risk as Low, Medium, or High
  • Returns clear reasons for the risk decision

Core Components

  • Context Builder
    Prepares a unified transaction context from user history and transaction input.

  • Rules Engine
    Independent heuristic rules for:

    • New receiver detection
    • New device detection
    • Unusually high transaction amount
    • Odd-hour transactions
  • Risk Engine
    Aggregates rule outputs, applies thresholds, and produces a final verdict.

  • Flask API
    Exposes the risk engine through a REST endpoint for frontend or service integration.


Tech Stack

  • Python
  • Flask
  • Rule-based heuristics
  • JSON / Supabase (data source)

API Endpoint

GET /evaluate_risk_score

Returns:

  • Risk score
  • Risk level
  • Verdict
  • Reasons for the decision

Project Goal

The goal of this module is to provide a fast, interpretable, and explainable fraud detection layer that can be extended later with machine learning models.


Status

Rule-based risk engine completed.
Ready for database and frontend integration.

About

A heuristics + ML based risk score engine built to generate a risk score out of 100 on the basis of few weighted predefined transaction rules.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages