Skip to content

Kofijoo/Customer-Risk-Scoring-Dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Customer Risk Scoring & AML Alerting System

Python License Status

A professional-grade risk assessment system for financial institutions, combining rule-based scoring with enhanced customer profiling for AML compliance and fraud detection.

🎯 Overview

This system provides comprehensive customer risk assessment by analyzing these:

  • Transaction patterns from PaySim financial data
  • Customer demographics with PEP (Politically Exposed Person) detection
  • Geographic risk factors including sanctions and FATF classifications
  • Enhanced risk scoring with weighted multi-factor analysis

πŸ—οΈ Architecture

β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ raw/                    # PaySim transaction data
β”‚   β”œβ”€β”€ processed/              # Enhanced customer profiles
β”‚   └── external/               # Reference data (sanctions, PEP lists)
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ config/                 # Configuration and logging
β”‚   β”œβ”€β”€ etl/                    # Data exploration and processing
β”‚   β”œβ”€β”€ features/               # Customer profiling engine
β”‚   β”œβ”€β”€ scoring/                # Risk scoring algorithms
β”‚   β”œβ”€β”€ screening/              # AML screening (planned)
β”‚   └── monitoring/             # Alert generation (planned)
β”œβ”€β”€ dashboard/                  # Visualization components (planned)
β”œβ”€β”€ models/                     # ML models and artifacts
β”œβ”€β”€ notebooks/                  # Exploratory data analysis
└── tests/                      # Unit and integration tests

✨ Key Features

πŸ” Risk Scoring Engine

  • Transaction Analysis: Pattern detection for TRANSFER, CASH_OUT, and high-value transactions
  • Fraud History: Weighted scoring based on historical fraud patterns
  • Amount Risk: Threshold-based risk assessment for large transactions
  • Cash Pattern Analysis: Detection of suspicious cash transaction behaviors

πŸ‘€ Customer Profiling

  • Demographic Enhancement: Age, nationality, occupation profiling
  • PEP Detection: Automated identification of Politically Exposed Persons
  • Geographic Risk: Country-based risk scoring using Basel AML Index
  • KYC Integration: Account age and verification status analysis

🌍 AML Compliance

  • Sanctions Screening: High-risk jurisdiction identification
  • FATF Classification: Grey/blacklist country detection
  • Enhanced Due Diligence: Multi-factor risk assessment
  • Regulatory Reporting: Structured risk categorization

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • pandas, numpy, pyyaml
  • PaySim transaction dataset

Installation

# Clone the repository
git clone https://github.com/Kofijoo/Customer-Risk-Scoring-Dashboard.git
cd Customer-Risk-Scoring-Dashboard

# Create virtual environment
python -m venv venv

# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

Usage

# Test the risk scoring engine
python -m src.scoring.risk_engine

# Generate customer profiles with enhanced risk scoring
python test_customer_profiler.py

# Explore PaySim data patterns
python analyze_paysim.py

πŸ“Š Sample Results

Risk Distribution

Enhanced Risk Categories:
β”œβ”€β”€ LOW: 874 customers (87.4%)
β”œβ”€β”€ MEDIUM: 122 customers (12.2%)
β”œβ”€β”€ HIGH: 4 customers (0.4%)
└── CRITICAL: 0 customers (0.0%)

PEP Detection

PEP Categories:
β”œβ”€β”€ NOT_PEP: 984 customers (98.4%)
β”œβ”€β”€ DOMESTIC_PEP: 12 customers (1.2%)
└── FOREIGN_PEP: 4 customers (0.4%)

Geographic Risk

High-Risk Jurisdictions:
β”œβ”€β”€ Russia (RU): 33 customers
β”œβ”€β”€ Iran (IR): 29 customers
β”œβ”€β”€ North Korea (KP): 27 customers
└── Afghanistan (AF): 17 customers

πŸ”§ Configuration

The system uses YAML-based configuration in src/config/settings.yaml:

risk_scoring:
  weights:
    transaction_risk: 0.40
    country_risk: 0.20
    pep_risk: 0.25
    demographic_risk: 0.10
    geographic_risk: 0.05
  
  thresholds:
    high_risk: 85
    medium_risk: 60
    low_risk: 30

πŸ“ˆ Risk Scoring Algorithm

The enhanced risk score combines multiple factors:

enhanced_risk_score = (
    transaction_risk * 0.40 +     # PaySim transaction patterns
    country_risk * 0.20 +         # Basel AML Index scores
    pep_risk * 0.25 +            # PEP status (highest weight)
    demographic_risk * 0.10 +     # Age, KYC, account factors
    geographic_risk * 0.05        # Sanctions, FATF flags
)

πŸ§ͺ Testing

# Run risk engine tests
python test_config.py

# Test customer profiler
python test_customer_profiler.py

# Analyze PaySim data
python analyze_paysim.py

πŸ“‹ Development Status

  • βœ… Phase 1: Foundation & Data Analysis
  • βœ… Phase 2: Risk Scoring Engine & Customer Profiling
  • πŸ”„ Phase 3: AML Alerting & Monitoring (In Progress)
  • ⏳ Phase 4: Dashboard & Visualization (Planned)

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ”— References

πŸ“ž Support

For questions and support, please open an issue in the GitHub repository. Let's connect.


Built for financial institutions requiring robust AML compliance and customer risk assessment capabilities.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages