{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"mount_file_id": "17NySOZHXz-Z8fGG-i6zpH1BGn8MGsPF_",
"authorship_tag": "ABX9TyNj0zZ+MNSd0XgS6OnnIvik",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
""
]
},
{
"cell_type": "markdown",
"source": [
"# Loan Approval Prediction Model\n",
"This is the link of the dataset :- [gdrive](https://drive.google.com/file/d/1LIvIdqdHDFEGnfzIgEh4L6GFirzsE3US/view?usp=sharing)\n",
"\n",
"\n",
"\n",
"_Source GeeksforGeeks_ "
],
"metadata": {
"id": "Aixd9CsjS4-Z"
}
},
{
"cell_type": "markdown",
"source": [
"## Importing the Modules & load the data\n"
],
"metadata": {
"id": "3u3IKHW6jYA5"
}
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"id": "IJNJ5pJBYlTd"
},
"outputs": [],
"source": [
"# Imports\n",
"import pandas as pd\n",
"import numpy as np\n",
"import seaborn as sn\n",
"import tensorflow as tf\n",
"from sklearn.model_selection import train_test_split"
]
},
{
"cell_type": "code",
"source": [
"# Load csv\n",
"data = pd.read_csv('/content/drive/MyDrive/LoanApprovalPrediction.csv')"
],
"metadata": {
"id": "naFm6bzI9lXw"
},
"execution_count": 4,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"## Data Cleaning"
],
"metadata": {
"id": "F0pZVXIJjmCW"
}
},
{
"cell_type": "code",
"source": [
"# Read the data\n",
"data.head()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 288
},
"id": "3DB0GLEgnXpd",
"outputId": "a9fd2529-d4c7-4efd-f69a-560ba74f1873"
},
"execution_count": 5,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" Loan_ID Gender Married Dependents Education Self_Employed \\\n",
"0 LP001002 Male No 0.0 Graduate No \n",
"1 LP001003 Male Yes 1.0 Graduate No \n",
"2 LP001005 Male Yes 0.0 Graduate Yes \n",
"3 LP001006 Male Yes 0.0 Not Graduate No \n",
"4 LP001008 Male No 0.0 Graduate No \n",
"\n",
" ApplicantIncome CoapplicantIncome LoanAmount Loan_Amount_Term \\\n",
"0 5849 0.0 NaN 360.0 \n",
"1 4583 1508.0 128.0 360.0 \n",
"2 3000 0.0 66.0 360.0 \n",
"3 2583 2358.0 120.0 360.0 \n",
"4 6000 0.0 141.0 360.0 \n",
"\n",
" Credit_History Property_Area Loan_Status \n",
"0 1.0 Urban Y \n",
"1 1.0 Rural N \n",
"2 1.0 Urban Y \n",
"3 1.0 Urban Y \n",
"4 1.0 Urban Y "
],
"text/html": [
"\n",
"\n",
"
\n", " | Loan_ID | \n", "Gender | \n", "Married | \n", "Dependents | \n", "Education | \n", "Self_Employed | \n", "ApplicantIncome | \n", "CoapplicantIncome | \n", "LoanAmount | \n", "Loan_Amount_Term | \n", "Credit_History | \n", "Property_Area | \n", "Loan_Status | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "LP001002 | \n", "Male | \n", "No | \n", "0.0 | \n", "Graduate | \n", "No | \n", "5849 | \n", "0.0 | \n", "NaN | \n", "360.0 | \n", "1.0 | \n", "Urban | \n", "Y | \n", "
1 | \n", "LP001003 | \n", "Male | \n", "Yes | \n", "1.0 | \n", "Graduate | \n", "No | \n", "4583 | \n", "1508.0 | \n", "128.0 | \n", "360.0 | \n", "1.0 | \n", "Rural | \n", "N | \n", "
2 | \n", "LP001005 | \n", "Male | \n", "Yes | \n", "0.0 | \n", "Graduate | \n", "Yes | \n", "3000 | \n", "0.0 | \n", "66.0 | \n", "360.0 | \n", "1.0 | \n", "Urban | \n", "Y | \n", "
3 | \n", "LP001006 | \n", "Male | \n", "Yes | \n", "0.0 | \n", "Not Graduate | \n", "No | \n", "2583 | \n", "2358.0 | \n", "120.0 | \n", "360.0 | \n", "1.0 | \n", "Urban | \n", "Y | \n", "
4 | \n", "LP001008 | \n", "Male | \n", "No | \n", "0.0 | \n", "Graduate | \n", "No | \n", "6000 | \n", "0.0 | \n", "141.0 | \n", "360.0 | \n", "1.0 | \n", "Urban | \n", "Y | \n", "