A comprehensive credit risk analysis and scoring platform built with Python 3.12 and PyQt6. This system enables financial institutions to assess customer default risk using advanced machine learning models, a user-friendly interface, and robust data management.
- Overview
- Features
- Technology Stack
- Project Structure
- Prerequisites
- Installation
- Database Setup
- Running the Application
- Usage Guide
- Team Members
- Contributing
- License
The Credit Risk Scoring System is a full-stack application designed to automate and enhance the process of credit risk assessment. It provides:
- A modern desktop interface for data entry, prediction, and reporting.
- Machine learning models (XGBoost, LightGBM, Logistic Regression) for risk scoring.
- Admin and user roles with tailored access and management features.
- Data visualization and model comparison tools.
- Customer data management and search
- Credit risk prediction using multiple ML models
- Model comparison and performance metrics (ROC-AUC, PR-AUC, Accuracy, etc.)
- Admin dashboard for model management and user administration
- Multi-currency support (VND/NT$)
- Audit logs and prediction history
- AI Assistant (Gemini integration, optional)
- Python 3.12 (recommended)
- PyQt6 for GUI
- scikit-learn, xgboost, lightgbm for ML
- MySQL for database
- pandas, numpy, matplotlib for data processing and visualization
MLBA_FinalProject/
├── main.py # Main entry point
├── ui/ # UI components (PyQt6)
├── services/ # Business logic and database services
├── ml/ # Machine learning scripts and models
├── models/ # Data models
├── outputs/ # Model files, evaluation results, charts
├── database/credit_risk_db/ # SQL schema files (import here!)
├── config/ # Configuration files
├── requirements.txt # Python dependencies
└── README.md # This file
- Python 3.12 (strongly recommended)
- MySQL server (tested with MySQL 8+)
- pip (Python package manager)
- Start MySQL Server and create a database (e.g.,
credit_risk_db). - Import Data Schema
- Open your MySQL client (Workbench, DBeaver, or command line).
- Import all
.sqlfiles from the folder:database/credit_risk_db/ - This will create all necessary tables: users, customers, predictions_log, model_registry, etc.
- (Optional) Update database credentials
- Edit
config/database_config.pyif your MySQL username/password is different.
- Edit
-
Train Machine Learning Models (first time only)
python ml/train_models.py
This will generate model files and evaluation data in
outputs/models/andoutputs/evaluation/. -
Start the Application
python main.py # or py -3.12 main.py
-
On launch, the login screen will appear. Use the following demo accounts:
Admin:
- Username:
ilovetranduythanh2 - Password:
10diem10diem
User:
- Username:
ilovetranduythanh1 - Password:
10diem10diem
- Username:
-
Admin can manage users, train models, view all predictions, and access system settings.
-
User can input customer data, make predictions, and view their own prediction history.
-
Use the "Model Management" tab (Admin) to train or activate new models.
-
All data is stored in the MySQL database.
- Fork the repository.
- Create a feature branch (
git checkout -b feature/YourFeature). - Commit your changes (
git commit -m 'Add YourFeature'). - Push to your branch (
git push origin feature/YourFeature). - Open a Pull Request.
This project is for educational purposes only. All rights reserved by the development team.