This project provides a comprehensive analysis of Aadhaar service stress risk across different districts. It uses a machine learning model to predict risk scores based on various operational data points, with a detailed Streamlit dashboard for in-depth analysis and a lightweight FastAPI backend with a simple frontend for quick risk checks.
Features
- Risk Prediction: A machine learning model predicts the service stress risk score for a given district and date.
- Interactive Dashboard: A Streamlit application provides a rich user interface to visualize risk trends, compare districts, and get detailed explanations.
- AI-Powered Recommendations: The application uses Google's Gemini API to generate policy recommendations for mitigating service stress.
- REST API: A FastAPI backend exposes several endpoints to access the risk data and model predictions.
- Minimalist Frontend: A simple HTML/JavaScript frontend to interact with the FastAPI backend.
API Endpoints
The FastAPI backend provides a rich set of endpoints:
GET /states— Get a list of all states.GET /districts/{state}— Get districts for a given state.GET /risk— Get the risk score and metrics for a given selection (state, district, date).GET /risk-verdict/{risk_score}— Get a qualitative risk verdict (LOW, MEDIUM, HIGH).GET /top-districts— Get the top 10 high-risk districts.GET /policy-recommendation/{state}/{district}/{date}— Generate an AI policy recommendation.GET /risk-explanation/{state}/{district}/{date}— Generate a detailed risk explanation.GET /download-ranked-data— Download a CSV of ranked district stress data.
Tech Stack
- Dashboard: Streamlit (Python)
- Backend: FastAPI, Uvicorn
- ML Model: Scikit-Learn (
.pklartifact) - AI: Google Gemini API
- Frontend: HTML, JavaScript

