Skip to content

DSinghania13/FinRisk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š FinRisk: AI at the Forefront of Financial Risk Management

FinRisk is a machine learning-driven credit risk prediction system designed to help lending institutions assess the likelihood of loan default using real-world financial data. The platform empowers organizations to make informed, data-backed lending decisions by leveraging advanced classification algorithms and interpretable AI models.

πŸ”— Live Demo

Access the live project here: View Deployed App


πŸ–ΌοΈ User Interface Preview

The following screenshots showcase the web-based user interface used to input borrower details and view credit risk predictions in real-time.

  • πŸ“₯ Input Form: Collects borrower attributes such as income, credit history, and loan amount
Credit Risk Prediction Form
  • πŸ“Š Prediction Output: Displays risk classification, probability scores, and recommendations
Prediction Result

🧠 Project Summary

FinRisk leverages Random Forest and Logistic Regression classifiers to predict whether a loan applicant is likely to default. The system is built with a focus on:

  • High accuracy and recall
  • Strong model interpretability
  • Deployment readiness via a Flask web interface

πŸ“Š Visual Representation of Datasets

These Power BI dashboards provide a comprehensive visual analysis of credit risk-related data. They illustrate patterns in loan distribution, borrower demographics, credit history, employment length, and more β€” enabling data-driven insights through intuitive visual representations.

Credit Risk Analysis Dashboard

This dashboard highlights the distribution of loan purposes, loan grades, home ownership, income levels, and credit history across borrowers.

Credit Risk Analysis

Loans Availed in 2007

This dashboard focuses on loan data from 2007, showcasing relationships between interest rates, annual income, employment length, and credit history by age.

Loans Availed in 2007


πŸ“ Project Structure

FINRISK/
β”œβ”€β”€ app/                        # Flask app code
β”‚   β”œβ”€β”€ app.py                 # Flask backend logic
β”‚   └── templates/
β”‚       └── form.html          # HTML form for user input
β”‚
β”œβ”€β”€ dataset/
β”‚   └── processed_credit_risk_dataset_encoded.csv
β”‚
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ finRisk_model.pkl      # Trained Random Forest model
β”‚   └── optimal_threshold.pkl  # Custom threshold object
β”‚
β”œβ”€β”€ notebooks/
β”‚   └── FinRisk_model.ipynb    # Model training and evaluation notebook
β”‚
β”œβ”€β”€ requirements.txt           # Python dependencies
β”œβ”€β”€ .gitignore                 # Files ignored by Git
└── README.md

πŸš€ Features

  • Binary classification of loan applicants: Default vs. No Default
  • Implements custom thresholding for classification sensitivity
  • Displays:
    • Probabilities
    • Risk categories (Low/Medium/High)
    • Model recommendation
  • Web form interface for real-time predictions

πŸ” Tech Stack

  • Frontend: HTML, CSS, JavaScript
  • Backend: Flask
  • ML Libraries: scikit-learn, imbalanced-learn, pandas, numpy
  • Visualization (in notebook): matplotlib, seaborn

πŸ“Š Dataset

The model is trained on a cleaned and encoded credit risk dataset that includes features such as:

  • Age, Income
  • Employment Length, Home Ownership
  • Loan Purpose, Amount, Grade
  • Credit History and Default Status

(Original source: Kaggle's Lending Club dataset)


πŸ› οΈ How to Run Locally

  1. Clone the repository
git clone https://github.com/your-username/finrisk.git
cd finrisk
  1. Set up a virtual environment
python -m venv venv
source venv/bin/activate    # On Windows: venv\Scripts\activate
  1. Install dependencies
pip install -r requirements.txt
  1. Run the Flask app
cd app
python app.py
  1. Open the browser and visit http://127.0.0.1:5000 to access the form.

πŸ“ˆ Model Details

  • Training Algorithms:
    • Logistic Regression (baseline, interpretable)
    • Random Forest (final, high-performing)
  • Performance Metrics:
    • Logistic Regresion -
      • Accuracy: 90%+
      • ROC-AUC: 0.89
    • Random Forest -
      • Accuracy: 90%+
      • ROC-AUC: 0.91
  • Feature Importance used to explain predictions

πŸ§ͺ Future Enhancements

  • Integration of XGBoost/LightGBM
  • SHAP-based interpretability for visual explanations
  • API endpoints for real-time financial systems
  • Multilingual UI for broader accessibility

πŸ‘¨β€πŸ’» Authors

β€œLend smarter, risk lesser” – because every informed decision counts in finance.


πŸ“ License

This project is licensed under the MIT License.
You are free to use, modify, and distribute this software with proper attribution.


About

An AI-powered credit risk assessment system using Random Forest and Logistic Regression to predict loan defaults. Features a Flask-based web interface, Power BI data analytics, and custom thresholding for optimized financial decision-making.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors