Loan_Recovery / README.md
Nikhillmahesh701's picture
Update README.md
8d927fa verified

A newer version of the Streamlit SDK is available: 1.45.1

Upgrade
metadata
title: Loan Recovery
emoji: πŸ“ˆ
colorFrom: purple
colorTo: green
sdk: streamlit
sdk_version: 1.44.1
app_file: app.py
pinned: false

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

Smart Loan Recovery System

A machine learning-powered system for predicting loan recovery probability with a Streamlit web interface.

Overview

The Smart Loan Recovery System helps financial institutions predict the likelihood of recovering loans by analyzing various customer and loan attributes. The system uses machine learning algorithms to provide insights that can help prioritize collection efforts and optimize recovery strategies.

System Workflow

System Workflow

The diagram above illustrates the complete workflow of the Smart Loan Recovery System:

  1. Data Input: Users can enter individual loan details or upload CSV files for batch processing
  2. Data Processing: The system preprocesses the data, performs feature engineering and normalization
  3. Random Forest Model: The prediction engine analyzes the data using the Random Forest algorithm
  4. Results Visualization: Interactive charts display recovery probability and risk assessment

The bottom section shows the key system components and their relationships, providing a clear overview of the system architecture.

Features

  • Predictive Analytics: Uses machine learning to predict loan recovery probability
  • Individual Loan Assessment: Analyze individual loans for recovery potential
  • Batch Processing: Process multiple loans at once for efficient analysis
  • Data Visualization: Interactive charts and graphs for better understanding
  • Risk Factor Identification: Highlights key factors affecting recovery

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/smart-loan-recovery-system.git
cd smart-loan-recovery-system
  1. Create a virtual environment and install dependencies:
python -m venv venv
source venv/Scripts/activate  # On Windows
# OR
source venv/bin/activate  # On macOS/Linux
pip install -r requirements.txt

Usage

  1. Generate sample data and train the Random Forest model:
python src/train_model.py
  1. Run the Streamlit application:
streamlit run app.py
  1. Open your browser and navigate to http://localhost:8501

Project Structure

smart-loan-recovery-system/
β”œβ”€β”€ app.py                                      # Main Streamlit application
β”œβ”€β”€ data/                                       # Data directory
β”‚   └── loan_data.csv                           # Sample loan data
β”œβ”€β”€ models/                                     # Trained models
β”‚   β”œβ”€β”€ loan_recovery_random_forest.pkl         # Trained Random Forest model
β”‚   └── loan_recovery_random_forest_processor.pkl # Model preprocessor
β”œβ”€β”€ screenshots/                                # Screenshots and diagrams
β”‚   β”œβ”€β”€ system_workflow.svg                     # System workflow diagram (SVG)
β”‚   β”œβ”€β”€ system_workflow.png                     # System workflow diagram (PNG)
β”‚   β”œβ”€β”€ system_workflow.html                    # System workflow diagram (HTML)
β”‚   β”œβ”€β”€ loan_input_form.png                     # UI screenshot - input form
β”‚   └── prediction_results.png                  # UI screenshot - results
β”œβ”€β”€ src/                                        # Source code
β”‚   β”œβ”€β”€ models/                                 # ML model implementations
β”‚   β”‚   └── loan_recovery_model.py              # Loan recovery model class
β”‚   β”œβ”€β”€ preprocessing/                          # Data preprocessing
β”‚   β”‚   └── data_processor.py                   # Data processor class
β”‚   β”œβ”€β”€ utils/                                  # Utility functions
β”‚   β”‚   └── data_generator.py                   # Synthetic data generator
β”‚   └── train_model.py                          # Script to train models
β”œβ”€β”€ Smart_Loan_Recovery_System_Documentation.docx # Comprehensive project documentation
β”œβ”€β”€ README.md                                   # Project overview
└── requirements.txt                            # Project dependencies

Machine Learning Model

The system uses a Random Forest model for loan recovery prediction:

Random Forest: An ensemble learning method that operates by constructing multiple decision trees. It provides high accuracy and can handle non-linear relationships in the data, making it ideal for loan recovery prediction.

Web Interface

The Streamlit web interface focuses solely on loan recovery prediction, providing a clean and intuitive interface for users to predict the probability of recovering loans.

Sample Interface

Loan Input Form

Sample Results

Prediction Results

The interface allows users to:

  • Enter individual loan details with comprehensive input fields
  • Upload CSV files for batch processing
  • View recovery probability with visual indicators
  • Receive recovery assessment and risk factor identification

Note: The screenshots above show sample results from the application. You'll need to add your own screenshots to the screenshots directory after running the application.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For more information, please contact [email protected]