How leerish/aml-risk-intelligence-platform works
Purpose and Entry Points
This is a batch AML analytics pipeline that converts PaySim-style financial transactions into SQL Server warehouse tables and Power BI investigation/reporting views. Primary execution assets are the analytical notebook at notebooks/AML-Analytics.ipynb, the database loader at src/data_to_sql.py, and SQL warehouse logic in sql/AML.sql.
Source Data and Analytics Processing
Python/Pandas performs dataset preparation and derives customer- and transaction-level fraud signals. The notebook is the likely interactive development and analytics entry point; src/data_to_sql.py operationalizes loading processed outputs into SQL Server. Raw/processed data directories described in the README are not present in this tree, so input-data location is an external/runtime dependency.
Customer Risk Profiling
Customer behavior is aggregated into the CustomerRisk analytical model: transaction volume, frequency, average amount, fraud history/rate, and derived risk category/score. This customer-level entity is the primary boundary between raw transaction events and compliance-oriented case prioritization. Relevant implementation locations: notebooks/AML-Analytics.ipynb, sql/AML.sql.
Alert and High-Risk Detection
The pipeline creates an investigator-facing AlertQueue from risk-ranked customers and identifies suspicious, high-value transaction records in HighRiskTransactions. These stages reduce the broader customer/transaction population into a reviewable operational scope. Core logic is represented in sql/AML.sql and the analytics notebook at notebooks/AML-Analytics.ipynb.
Transaction and Trend Intelligence
Transaction-level aggregation produces TransactionSummary, including fraud concentration by channel/type, while time-series rollups produce DailyTransactionMetrics for fraud and alert trend monitoring. These warehouse-ready models support exposure analysis, anomaly/spike visibility, and dashboard filtering. Paths: sql/AML.sql, notebooks/AML-Analytics.ipynb.
Warehouse Boundary and Connectivity
Microsoft SQL Server is the persistent analytics warehouse and integration boundary between computation and BI. Python connects through SQLAlchemy and PyODBC; src/data_to_sql.py is the load boundary and src/test_connection.py provides connection validation. SQL-side transformations/schema definitions are centralized in sql/AML.sql.
Reporting and Runtime Environment
Power BI Desktop consumes the warehouse models through the packaged report at dashboards/AML-Analtyics.pbix; dashboard screenshots belong under dashboards/screenshots. The runtime is Python 3.10-oriented Conda with Pandas, SQLAlchemy, and PyODBC dependencies defined by environment.yml and requirements.txt. External services/infrastructure are the PaySim dataset source, a reachable SQL Server instance, and Power BI Desktop.
Main entry points: AML.sql Warehouse SQL logic · AML-Analtyics.pbix AML Analytics report · AML-Analytics.ipynb AML analytics notebook · data_to_sql.py SQL loader
Components 12
Analytics Processing
- AML analytics notebook · Interactive preparation and fraud-signal development entry point.
notebooks/AML-Analytics.ipynb - SQL loader · Operational boundary that loads processed outputs through SQLAlchemy and PyODBC.
src/data_to_sql.py - Connection validation
src/test_connection.py
SQL Server Warehouse
- Warehouse SQL logic · Centralized warehouse definitions and SQL-side transformations.
sql/AML.sql - SQL Server · Persistent integration boundary between analytics and BI.
- CustomerRisk · Customer behavior, fraud history, and derived risk score/category.
- AlertQueue · Risk-ranked customers reduced to a reviewable scope.
- HighRiskTransactions · High-value suspicious transactions for investigation.
- TransactionSummary · Fraud concentration by transaction channel and type.
- DailyTransactionMetrics · Daily fraud and alert trends for spike monitoring.
Investigation & Reporting
- AML Analytics report · Investigation and reporting views over warehouse models.
dashboards/AML-Analtyics.pbix
Other components
- PaySim dataset · Runtime dependency; source files are outside the repository.
Connections 16
- PaySim dataset → AML analytics notebook: raw transactions
- AML analytics notebook → SQL loader: processed outputs
- SQL loader → SQL Server: loads via SQLAlchemy/PyODBC
- Connection validation → SQL Server: validates connectivity
- Warehouse SQL logic → SQL Server: defines and transforms
- AML analytics notebook → CustomerRisk: derives risk signals
- Warehouse SQL logic → CustomerRisk: builds
- CustomerRisk → AlertQueue: risk-ranked customers
- Warehouse SQL logic → HighRiskTransactions: identifies
- Warehouse SQL logic → TransactionSummary: aggregates
- Warehouse SQL logic → DailyTransactionMetrics: rolls up
- SQL Server → AML Analytics report: warehouse connection
- AlertQueue → AML Analytics report: case prioritization
- HighRiskTransactions → AML Analytics report: transaction investigation
- TransactionSummary → AML Analytics report: exposure analysis
- DailyTransactionMetrics → AML Analytics report: trend monitoring