A machine learning-powered web application that predicts customer credit scores using advanced classification algorithms. Built with Python, Streamlit, and Random Forest.
- Overview
- Features
- Demo
- Installation
- Usage
- Project Structure
- Model Information
- Tech Stack
- Contributing
- License
This project implements a complete credit score classification pipeline that:
- Analyzes customer financial data to predict credit worthiness
- Classifies customers into three categories: Good, Standard, and Poor
- Provides an interactive web interface for real-time predictions
- Offers actionable recommendations based on predictions
- 🤖 Machine Learning Model: Random Forest classifier trained on comprehensive credit data
- 🌐 Interactive Web App: Modern, responsive Streamlit interface with dark theme
- 📊 Real-time Predictions: Instant credit score classification with probability scores
- 💡 Smart Recommendations: Tailored suggestions based on prediction outcomes
- 📈 Visual Analytics: Interactive probability charts using Plotly
| Resource | Link |
|---|---|
| Model Card | AdityaaXD/credit-score-classifier |
| Dataset Card | AdityaaXD/Credit-Score-Classification |
The application features a premium dark-themed UI with:
- Easy-to-use input forms for customer data
- Real-time prediction results with confidence scores
- Probability distribution visualization
- Python 3.8 or higher
- pip package manager
-
Clone the repository
git clone https://github.com/yourusername/credit-score-classification.git cd credit-score-classification -
Create a virtual environment (optional but recommended)
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Run the application
streamlit run app.py
-
Open your browser and navigate to
http://localhost:8501
- Navigate to the Predict tab in the application
- Enter customer information:
- Numerical Features: Age, Annual Income, Number of Bank Accounts, etc.
- Categorical Features: Occupation, Credit Mix, Payment Behavior, etc.
- Click "Predict Credit Score"
- Review results: View the prediction, confidence scores, and recommendations
| Feature | Type | Description |
|---|---|---|
| Age | Numerical | Customer's age |
| Annual_Income | Numerical | Yearly income in currency |
| Monthly_Inhand_Salary | Numerical | Monthly take-home salary |
| Num_Bank_Accounts | Numerical | Total bank accounts owned |
| Num_Credit_Card | Numerical | Number of credit cards |
| Interest_Rate | Numerical | Average interest rate on credit |
| Num_of_Loan | Numerical | Number of active loans |
| Delay_from_due_date | Numerical | Average delay in payments (days) |
| Outstanding_Debt | Numerical | Total outstanding debt |
| Credit_Utilization_Ratio | Numerical | Credit utilization percentage |
| Credit_History_Age_Months | Numerical | Credit history length in months |
| Occupation | Categorical | Employment type |
| Credit_Mix | Categorical | Types of credit accounts |
| Payment_Behaviour | Categorical | Spending patterns |
| Payment_of_Min_Amount | Categorical | Minimum payment behavior |
Credit Score Classification/
├── 📄 app.py # Streamlit web application
├── 📓 Credit_Score_Classification.ipynb # Jupyter notebook with EDA & training
├── 📄 requirements.txt # Python dependencies
├── 📄 README.md # This file
├── 📊 train.csv # Training dataset
├── 📊 test.csv # Test dataset
└── 📊 submission.csv # Model predictions
The trained model artifacts are hosted on Hugging Face Hub and are automatically downloaded when you run the application:
| File | Description |
|---|---|
models/final_model.pkl |
Random Forest classifier |
models/scaler.pkl |
Feature scaler |
models/label_encoder.pkl |
Target label encoder |
models/feature_info.pkl |
Feature metadata |
models/onehot_encoder.pkl |
Categorical encoder |
- Model: Random Forest Classifier (n_estimators=100)
- Target Classes: Good, Standard, Poor
- Numerical Features: 17 scaled features including financial metrics
- Categorical Features: 5 one-hot encoded features
- Preprocessing: StandardScaler for numerical, OneHotEncoder for categorical
The model was trained on a comprehensive credit dataset with features covering:
- Payment history
- Credit utilization
- Account composition
- Financial behavior patterns
| Category | Technology |
|---|---|
| Language | Python 3.8+ |
| ML Framework | Scikit-learn |
| Web Framework | Streamlit |
| Model Hosting | Hugging Face Hub |
| Data Processing | Pandas, NumPy |
| Visualization | Plotly, Matplotlib, Seaborn |
| Development | Jupyter Notebook |
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request