A professional-grade risk assessment system for financial institutions, combining rule-based scoring with enhanced customer profiling for AML compliance and fraud detection.
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
βββ 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
- 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
- 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
- Sanctions Screening: High-risk jurisdiction identification
- FATF Classification: Grey/blacklist country detection
- Enhanced Due Diligence: Multi-factor risk assessment
- Regulatory Reporting: Structured risk categorization
- Python 3.8+
- pandas, numpy, pyyaml
- PaySim transaction dataset
# 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# 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.pyEnhanced Risk Categories:
βββ LOW: 874 customers (87.4%)
βββ MEDIUM: 122 customers (12.2%)
βββ HIGH: 4 customers (0.4%)
βββ CRITICAL: 0 customers (0.0%)
PEP Categories:
βββ NOT_PEP: 984 customers (98.4%)
βββ DOMESTIC_PEP: 12 customers (1.2%)
βββ FOREIGN_PEP: 4 customers (0.4%)
High-Risk Jurisdictions:
βββ Russia (RU): 33 customers
βββ Iran (IR): 29 customers
βββ North Korea (KP): 27 customers
βββ Afghanistan (AF): 17 customers
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: 30The 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
)# Run risk engine tests
python test_config.py
# Test customer profiler
python test_customer_profiler.py
# Analyze PaySim data
python analyze_paysim.py- β Phase 1: Foundation & Data Analysis
- β Phase 2: Risk Scoring Engine & Customer Profiling
- π Phase 3: AML Alerting & Monitoring (In Progress)
- β³ Phase 4: Dashboard & Visualization (Planned)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
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.