--- title: ECL Risk Analyzer emoji: 💹 colorFrom: red colorTo: red sdk: docker app_port: 8501 tags: - streamlit - credit-risk - gemini - finance pinned: false short_description: AI ECL analyzer using Streamlit and Gemini. --- # 🧮 ECL Risk Analyzer **ECL Risk Analyzer** is a Streamlit-based web app that automates **Expected Credit Loss (ECL)** analysis and provides **AI-driven recommendations** on credit decisions. ### 🔍 Features - Upload loan datasets (CSV format). - Compute key credit metrics: - **PD** – Probability of Default - **LGD** – Loss Given Default - **EAD** – Exposure at Default - **ECL** – Expected Credit Loss - Visualize segment-level performance with interactive charts. - Get AI recommendations (via **Gemini 2.5 Flash Lite**) to: - Increase interest - Reduce disbursement - Maintain current policy - Role-based access: - **Analyst:** Run and review segment analyses. - **CRO:** Audit all analyst reports and view trends. ### 🧠 Tech Stack - **Frontend:** Streamlit - **AI Engine:** Gemini API - **Database:** SQLite (via SQLAlchemy) - **Hosting:** Hugging Face Spaces (Docker SDK) ### 🚀 Quick Start 1. Upload your loan dataset (CSV). 2. Select a segmentation column (e.g., loan intent, area, or occupation). 3. View computed ECL metrics and charts. 4. Choose a segment to get AI-based recommendations. ### 📊 Example Output | Segment | PD | LGD | EAD | ECL | Action | |----------|----|-----|-----|-----|--------| | Medical | 0.278 | 0.255 | 78M | 5.5M | Increase Interest | ### 🛠️ Customization Modify `/src/streamlit_app.py` to: - Adjust prompts or logic. - Change chart styles. - Extend user roles or security.