Predictive Loan Analysis is a machine learning project aimed at predicting whether a customer is likely to accept a personal loan based on various attributes such as age, income, education, family size, etc. The project involves data exploration, feature selection, and the development of a predictive model using the Random Forest Classifier.
The project provides insights into loan acceptance patterns, helps financial institutions make informed decisions, and automates the prediction process.
- Data Exploration: Visualizing data distributions and relationships.
- Feature Selection: Identifying the most important features for loan acceptance prediction.
- Predictive Modeling: Building and training a Random Forest model.
- Evaluation: Measuring model performance using accuracy and classification metrics.
- Python: Programming language used for data processing and model development.
- Pandas: For data manipulation and analysis.
- Matplotlib/Seaborn: Data visualization libraries.
- Scikit-learn: Machine learning algorithms and utilities.
- Joblib: Saving and loading the trained model.
The dataset contains 5000 records with the following attributes:
- ID: Unique identifier.
- Pin-code: Residential area code.
- Age: Age of the customer.
- Fam members: Number of family members.
- Education: Education level (Under Graduate/Graduate).
- T. Experience: Total professional experience in years.
- Income: Annual income (in local currency).
- Mortgage: Mortgage amount (if any).
- Fixed Deposit: Whether the customer has a fixed deposit (yes/no).
- Demat: Whether the customer has a Demat account (yes/no).
- Net Banking: Whether the customer uses net banking (yes/no).
- Loan: Whether the customer applied for a loan (yes/no).
|-- datasets/
| |-- loan_dataset.csv # The dataset for the analysis
|-- loan_analysis.py # Main Python script for data analysis and model building
|-- loan_prediction_model.pkl # Saved trained model
|-- requirements.txt # List of dependencies for the project
|-- README.md # Project documentationgit clone https://github.com/your-username/predictive-loan-analysis.git
cd predictive-loan-analysispython -m venv venv
source venv/bin/activate # For Windows: venv\Scripts\activateInstall all required Python packages using the requirements.txt file:
pip install -r requirements.txtAfter setting up the environment and installing dependencies, run the main analysis script:
python loan_analysis.py- The model will be trained and saved as
loan_prediction_model.pkl. - Classification results and model performance will be displayed in the console.
This project is licensed under the MIT License. You are free to use, modify, and distribute this project, provided that all copies include the original copyright notice and license. For more details, please refer to the LICENSE file included in this repository.