This repository contains the code for a loan approval prediction model. The model is designed to predict whether a loan will be approved based on various features such as education, employment status, and the number of dependents.
The goal of this project is to build a predictive model that can accurately determine the likelihood of a loan being approved. This model can be useful for financial institutions to make informed decisions about loan approvals.
The dataset used for this project is a loan approval dataset, which includes features such as:
- Education level
- Employment status
- Number of dependents
- Loan status (approved or not)
The dataset is loaded from a CSV file named loan_approval_dataset.csv
.
The project uses the following steps:
- Data Exploration: Initial analysis of the dataset to understand the structure, missing values, and unique values in each column.
- Data Preprocessing: Encoding categorical variables using
LabelEncoder
fromsklearn.preprocessing
. - Feature Engineering: Visualizing the distribution of categorical features and their relationship with the loan status.
- Model Training: Training two models - Logistic Regression and RandomForestClassifier - to predict the loan status.
- Model Evaluation: Evaluating the models using accuracy score and comparing their performance.
Two models are used in this project:
- Logistic Regression: A simple yet powerful model for binary classification problems.
- RandomForestClassifier: An ensemble learning method that operates by constructing multiple decision trees at training time and outputting the class that is the mode of the classes of the individual trees.
The model's performance is evaluated using the accuracy score. The results are compared between the two models to determine which one performs better on the loan approval prediction task.
- Clone this repository.
- Install the required Python packages:
pandas
,numpy
,matplotlib
,seaborn
,sklearn
. - Run the Jupyter notebook
Project1.ipynb
to execute the code and see the results.
Contributions are welcome. Please feel free to submit a pull request or open an issue to discuss potential improvements.
This project is licensed under the MIT License. See the LICENSE
file for details.