This model predicts the loan status whether it is "Approved" or "Not Approved" depending on relevant details of the applicant through machine learning models. In addition, a user-friendly GUI is featured to predict the status of a given loan application.
- Python 3.x
-
Download the repository as a zip file from this link.
-
Extract the downloaded zip file to a directory of your choice.
-
Open a terminal or command prompt and change directory to the extracted folder (Loan_Prediction_Model).
-
Install dependencies:
pip install -r requirements.txt
To run the model, execute:
python main.py
To launch the GUI for making predictions, execute -
python gui.py
- Predict loan status using multiple machine learning models.
- User-friendly GUI for inputting applicant details and displaying prediction results.
- Model performance evaluation and comparison.
This dataset is taken from Kaggle and contains the following details about bank loan applicants-
-
Loan_ID: A unique identifier for each loan application.
-
Gender: The gender of the applicant. Typically, values are 'Male' or 'Female'.
-
Married: Indicates the marital status of the applicant. Values are 'Yes' or 'No'.
-
Dependents: The number of dependents the applicant has. This can be a numeric value, including '0', '1', '2', '3+' (which might be represented as '4' in some cases after processing).
-
Education: Indicates the education level of the applicant. Values are 'Graduate' or 'Not Graduate'.
-
Self_Employed: Indicates whether the applicant is self-employed. Values are 'Yes' or 'No'.
-
ApplicantIncome: The income of the applicant.
-
CoapplicantIncome: The income of the co-applicant, if any. This value can be '0' if there is no co-applicant.
-
LoanAmount: The amount of loan requested by the applicant. Typically, this is in thousands of currency units.
-
Loan_Amount_Term: The term of the loan in months. For example, '360' indicates a loan term of 360 months (30 years).
-
Credit_History: A binary indicator of the applicant's credit history. A value of '1' means the applicant has a good credit history, while '0' indicates a bad credit history.
-
Property_Area: The area where the property is located. This can be 'Urban', 'Semiurban', or 'Rural'.
-
Loan_Status: The status of the loan application. 'Y' means the loan was approved, and 'N' means it was not approved.
- Logistic Regression
- Support Vector Machine (SVM)
- Decision Tree Classifier
- Random Forest Classifier
- Gradient Boosting Classifier
The Random Forest Classifier and the Support Vector Machine achieved the best performance with an accuracy of 80.66% after hyperparameter tuning.
- Logistic Regression
- Before Tuning: 79.3%
- After Tuning: 80.29%
- Support Vector Machine (SVM)
- Before Tuning: 80.18%
- After Tuning: 80.66%
- Random Forest Classifier
- Before Tuning: 77.47%
- After Tuning: 80.66%
A simple GUI is provided to input the loan application details and get the prediction.
Contributions are welcome! Please fork the repository and create a pull request with a clear description of your changes.
This project is licensed under the MIT License. See the LICENSE file for more details.