Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ FinCompass

Banking Complaint Intelligence & Supervisory Analytics Platform

An end-to-end data engineering and supervisory analytics platform simulating RBI-grade consumer protection and market intelligence operations.

Python Pandas NumPy scikit-learn StatsModels SQLAlchemy Streamlit LangChain ChromaDB Gemini Plotly

License PRs Welcome Status


πŸ“– Overview

FinCompass is a full-stack data engineering and analytics platform that simulates the Reserve Bank of India's (RBI) consumer protection and market intelligence operations end-to-end. It ingests synthetic grievance records, cleans and structures them into a relational database, applies statistical hypothesis testing and time-series forecasting, trains an NLP classifier on raw complaint text, builds a vector search index for semantic Q&A, and serves everything through an interactive 6-page Streamlit supervisory dashboard β€” complete with automated PDF/Word/Excel brief generation.

This project was purpose-built to demonstrate the core competencies required for RBI Young Professional (YP) roles in Data Analytics and Policy Research: data pipeline engineering, statistical inference, forecasting, applied ML/NLP, and translating quantitative findings into policy-ready supervisory briefs.


πŸ—οΈ Platform Architecture

                            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                            β”‚   15,000 Complaints         β”‚
                            β”‚   (Synthetic Raw Data)       β”‚
                            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                           β”‚  ETL Pipeline (pandas & NumPy)
                                           β–Ό
                            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                            β”‚   clean_validate.py          β”‚
                            β”‚   (Z-score outliers, DQ)      β”‚
                            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                           β”‚  Ingestion (SQLAlchemy)
                                           β–Ό
                            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                            β”‚      fincompass.db           β”‚
                            β”‚   (SQLite3 Relational DB)     β”‚
                            β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚             β”‚
                  ML & NLP        β–Ό             β–Ό        Analytics & Time-Series
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚  train_classifier.py    β”‚   β”‚   stats_analysis.py     β”‚
              β”‚  (TF-IDF + LogReg)      β”‚   β”‚  (Welch's t-test, OLS)  β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β–Ό                            β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚  complaint_classifier   β”‚   β”‚    forecasting.py       β”‚
              β”‚     (Saved .pkl)         β”‚   β”‚  (SARIMA Forecast JSON) β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚                            β”‚
                           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                        β–Ό
                            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                            β”‚      streamlit_app           │◀──┐  RAG Assistant
                            β”‚      (6-Page App)             β”‚   β”‚
                            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
                                           β”‚                  β”‚
                                           β–Ό        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚     chatbot.py         β”‚
                            β”‚   Word / Excel MIS       β”‚   β”‚ (LangChain + Chroma)   β”‚
                            β”‚      Generators            β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β”‚
                                                                       β–Ό
                                                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                                          β”‚   Gemini Flash API    β”‚
                                                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Technology Stack

Layer Technologies Purpose
🐍 Core Language Python 3.10+ Primary language for pipeline, analytics, and modeling
πŸ—„οΈ Database SQLite3, SQLAlchemy Relational storage with window functions, JOINs
βš™οΈ Pipeline Pandas, NumPy Structured ETL validation, cleaning, log generation
πŸ“Š Statistics SciPy, StatsModels Welch's t-test, OLS regression, Mann-Kendall trend test
πŸ“ˆ Time-Series statsmodels SARIMAX 6-month seasonal complaint volume forecasting
πŸ€– ML / NLP scikit-learn TF-IDF pipeline + Multinomial Logistic Regression
🧠 GenAI / RAG LangChain, ChromaDB, Gemini Flash Semantic vector search & Q&A over supervisory briefs
πŸ“ Automation python-docx, openpyxl, APScheduler Automated Word briefs, conditional-formatted Excel MIS
🎨 Visualization Plotly, Streamlit Interactive multi-page dashboard

πŸ“‹ Methodology

1. Data Synthesis & Distribution Rationale

Synthetic data is modeled to reflect realistic system loads under the Integrated Ombudsman Scheme, rather than uniform random distributions:

  • Market share weighting β€” SBI accounts for ~20% of complaints, matching its domestic footprint, followed by public sector peers.
  • Macroeconomic trends β€” Digital Banking Fraud is modeled with a 25% YoY compound growth rate, simulating post-COVID digital transaction growth.
  • Supervisory discrepancy β€” Public sector banks are assigned a gamma distribution for resolution_days, yielding a ~43-day mean (~40% slower than private counterparts).

2. ETL Cleaning & Data Quality Assurance (clean_validate.py)

  • Outliers in resolution_days flagged via a standard Z-score threshold (Z > 3).
  • Inconsistencies repaired β€” e.g., resolution_days set to null for pending complaints, and resolved entries missing day counts filled with the bank type's median.
  • Full execution steps and metrics exported to etl/etl_log.txt.

3. Statistical Inference & Predictive Analytics

  • Welch's t-test β€” independent two-sample test with unequal variances, comparing public vs. private bank resolution days.
  • OLS Regression β€” predicts resolution days from bank type, channel, and complaint category to isolate systemic friction points.
  • Mann-Kendall Test β€” non-parametric test for a monotonic upward trend in Digital Banking Fraud.

πŸš€ Getting Started

Prerequisites

  • Python 3.10+

Installation & Full Pipeline Run

# 1. Clone the repository
git clone https://github.com/yourusername/FinCompass.git
cd FinCompass

# 2. Install dependencies
pip install -r requirements.txt

# 3. Run the end-to-end orchestrator
# (data generation β†’ validation β†’ DB load β†’ ML training β†’ stats β†’ vector store β†’ MIS generation)
python run_all.py

Optional: Enable the Live AI Policy Assistant

Create a .env file at the project root:

GEMINI_API_KEY=your_google_studio_api_key_here

If no key is provided, the chatbot gracefully falls back to a local semantic synthesis mode.

Launch the Dashboard

streamlit run app/streamlit_app.py

πŸ“ˆ Key Findings (Based on Simulated Data)

Finding Statistical Evidence
πŸ›οΈ Systemic backlogs in public sector banks Welch's t-test: p < 0.001 (null hypothesis rejected)
πŸ“± Digital Banking Fraud rising sharply Mann-Kendall Tau: +0.84, p < 0.0001
🏒 Branch-filed complaints add friction OLS regression: +14.2 days vs. online filings

πŸ›οΈ Policy Implications (DoS Brief)

I. Institutional Action Plan The persistent gap in grievance redressal velocity between public and private sector banks points to a structural bottleneck in consumer protection. The analysis recommends the Department of Supervision (DoS) mandate specialized workflow automation for public sector banks whose average resolution time exceeds a 45-day threshold, alongside periodic spot audits of internal bank ombudsman frameworks.

II. Mitigation of Digital Transaction Risks Given the statistically validated acceleration in Digital Banking Fraud, the analysis suggests a regulatory update to the Master Direction on Digital Banking Security Controls β€” including mandatory real-time transaction cooling periods for high-risk accounts and stricter security audits for third-party UPI integrations, with particular focus on Small Finance Banks showing sudden QoQ complaint spikes.


πŸ–ΌοΈ Dashboard Pages

# Page Description
1 Executive Dashboard High-level KPIs and complaint volume overview
2 Complaint Deep Dive Real-time NLP classifier on raw complaint text
3 DoS Supervisory Monitoring Bank-level resolution velocity tracking
4 Heatmap & Geographic Analysis Regional complaint density visualization
5 Time-Series Forecasting & Stats SARIMA forecasts and hypothesis test results
6 AI Policy Assistant RAG-powered chat over monthly supervisory briefs

πŸ“Έ Replace this table with actual screenshots/GIFs per page once available β€” a 2-column image grid works well here.


πŸ—ΊοΈ Roadmap

  • Swap synthetic data generator for anonymized real-world grievance datasets
  • Add role-based access control for the supervisory dashboard
  • Expand forecasting to per-bank and per-region granularity
  • CI/CD pipeline for automated model retraining
  • Deploy live demo (Streamlit Cloud / Docker)

⚠️ Disclaimer

This project uses entirely synthetic data and is built as an independent portfolio/demonstration project. It is not affiliated with, endorsed by, or representative of official RBI systems, data, or policy positions.


🀝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


Built with πŸ›‘οΈ for data-driven supervisory intelligence.

Releases

Packages

Contributors

Languages