Created
June 2, 2022 11:49
-
-
Save ankitbora31/8eac7d07a4262a3aa78af0d7ad74a773 to your computer and use it in GitHub Desktop.
machine Learning capstone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"<center>\n", | |
" <img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-ML0101EN-SkillsNetwork/labs/FinalModule_Coursera/images/IDSNlogo.png\" width=\"300\" alt=\"cognitiveclass.ai logo\" />\n", | |
"</center>\n", | |
"\n", | |
"<h1 align=\"center\"><font size=\"5\">Classification with Python</font></h1>\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"In this notebook we try to practice all the classification algorithms that we have learned in this course.\n", | |
"\n", | |
"We load a dataset using Pandas library, and apply the following algorithms, and find the best one for this specific dataset by accuracy evaluation methods.\n", | |
"\n", | |
"Let's first load required libraries:\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 128, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"import itertools\n", | |
"import numpy as np\n", | |
"import matplotlib.pyplot as plt\n", | |
"from matplotlib.ticker import NullFormatter\n", | |
"import pandas as pd\n", | |
"import numpy as np\n", | |
"import matplotlib.ticker as ticker\n", | |
"from sklearn import preprocessing\n", | |
"%matplotlib inline" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### About dataset\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"This dataset is about past loans. The **Loan_train.csv** data set includes details of 346 customers whose loan are already paid off or defaulted. It includes following fields:\n", | |
"\n", | |
"| Field | Description |\n", | |
"| -------------- | ------------------------------------------------------------------------------------- |\n", | |
"| Loan_status | Whether a loan is paid off on in collection |\n", | |
"| Principal | Basic principal loan amount at the |\n", | |
"| Terms | Origination terms which can be weekly (7 days), biweekly, and monthly payoff schedule |\n", | |
"| Effective_date | When the loan got originated and took effects |\n", | |
"| Due_date | Since it’s one-time payoff schedule, each loan has one single due date |\n", | |
"| Age | Age of applicant |\n", | |
"| Education | Education of applicant |\n", | |
"| Gender | The gender of applicant |\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"Let's download the dataset\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"--2022-06-01 19:21:40-- https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-ML0101EN-SkillsNetwork/labs/FinalModule_Coursera/data/loan_train.csv\n", | |
"Resolving cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud (cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud)... 169.45.118.108\n", | |
"Connecting to cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud (cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud)|169.45.118.108|:443... connected.\n", | |
"HTTP request sent, awaiting response... 200 OK\n", | |
"Length: 23101 (23K) [text/csv]\n", | |
"Saving to: 'loan_train.csv'\n", | |
"\n", | |
" 0K .......... .......... .. 100% 1.50M=0.01s\n", | |
"\n", | |
"2022-06-01 19:21:42 (1.50 MB/s) - 'loan_train.csv' saved [23101/23101]\n", | |
"\n" | |
] | |
} | |
], | |
"source": [ | |
"!wget -O loan_train.csv https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-ML0101EN-SkillsNetwork/labs/FinalModule_Coursera/data/loan_train.csv" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### Load Data From CSV File\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 129, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>Unnamed: 0</th>\n", | |
" <th>Unnamed: 0.1</th>\n", | |
" <th>loan_status</th>\n", | |
" <th>Principal</th>\n", | |
" <th>terms</th>\n", | |
" <th>effective_date</th>\n", | |
" <th>due_date</th>\n", | |
" <th>age</th>\n", | |
" <th>education</th>\n", | |
" <th>Gender</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>9/8/2016</td>\n", | |
" <td>10/7/2016</td>\n", | |
" <td>45</td>\n", | |
" <td>High School or Below</td>\n", | |
" <td>male</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>2</td>\n", | |
" <td>2</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>9/8/2016</td>\n", | |
" <td>10/7/2016</td>\n", | |
" <td>33</td>\n", | |
" <td>Bechalor</td>\n", | |
" <td>female</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>3</td>\n", | |
" <td>3</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>15</td>\n", | |
" <td>9/8/2016</td>\n", | |
" <td>9/22/2016</td>\n", | |
" <td>27</td>\n", | |
" <td>college</td>\n", | |
" <td>male</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>4</td>\n", | |
" <td>4</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>9/9/2016</td>\n", | |
" <td>10/8/2016</td>\n", | |
" <td>28</td>\n", | |
" <td>college</td>\n", | |
" <td>female</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4</th>\n", | |
" <td>6</td>\n", | |
" <td>6</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>9/9/2016</td>\n", | |
" <td>10/8/2016</td>\n", | |
" <td>29</td>\n", | |
" <td>college</td>\n", | |
" <td>male</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" Unnamed: 0 Unnamed: 0.1 loan_status Principal terms effective_date \\\n", | |
"0 0 0 PAIDOFF 1000 30 9/8/2016 \n", | |
"1 2 2 PAIDOFF 1000 30 9/8/2016 \n", | |
"2 3 3 PAIDOFF 1000 15 9/8/2016 \n", | |
"3 4 4 PAIDOFF 1000 30 9/9/2016 \n", | |
"4 6 6 PAIDOFF 1000 30 9/9/2016 \n", | |
"\n", | |
" due_date age education Gender \n", | |
"0 10/7/2016 45 High School or Below male \n", | |
"1 10/7/2016 33 Bechalor female \n", | |
"2 9/22/2016 27 college male \n", | |
"3 10/8/2016 28 college female \n", | |
"4 10/8/2016 29 college male " | |
] | |
}, | |
"execution_count": 129, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"df = pd.read_csv('loan_train.csv')\n", | |
"df.head()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 130, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"(346, 10)" | |
] | |
}, | |
"execution_count": 130, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"df.shape" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### Convert to date time object\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 131, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>Unnamed: 0</th>\n", | |
" <th>Unnamed: 0.1</th>\n", | |
" <th>loan_status</th>\n", | |
" <th>Principal</th>\n", | |
" <th>terms</th>\n", | |
" <th>effective_date</th>\n", | |
" <th>due_date</th>\n", | |
" <th>age</th>\n", | |
" <th>education</th>\n", | |
" <th>Gender</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>2016-09-08</td>\n", | |
" <td>2016-10-07</td>\n", | |
" <td>45</td>\n", | |
" <td>High School or Below</td>\n", | |
" <td>male</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>2</td>\n", | |
" <td>2</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>2016-09-08</td>\n", | |
" <td>2016-10-07</td>\n", | |
" <td>33</td>\n", | |
" <td>Bechalor</td>\n", | |
" <td>female</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>3</td>\n", | |
" <td>3</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>15</td>\n", | |
" <td>2016-09-08</td>\n", | |
" <td>2016-09-22</td>\n", | |
" <td>27</td>\n", | |
" <td>college</td>\n", | |
" <td>male</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>4</td>\n", | |
" <td>4</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>2016-09-09</td>\n", | |
" <td>2016-10-08</td>\n", | |
" <td>28</td>\n", | |
" <td>college</td>\n", | |
" <td>female</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4</th>\n", | |
" <td>6</td>\n", | |
" <td>6</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>2016-09-09</td>\n", | |
" <td>2016-10-08</td>\n", | |
" <td>29</td>\n", | |
" <td>college</td>\n", | |
" <td>male</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" Unnamed: 0 Unnamed: 0.1 loan_status Principal terms effective_date \\\n", | |
"0 0 0 PAIDOFF 1000 30 2016-09-08 \n", | |
"1 2 2 PAIDOFF 1000 30 2016-09-08 \n", | |
"2 3 3 PAIDOFF 1000 15 2016-09-08 \n", | |
"3 4 4 PAIDOFF 1000 30 2016-09-09 \n", | |
"4 6 6 PAIDOFF 1000 30 2016-09-09 \n", | |
"\n", | |
" due_date age education Gender \n", | |
"0 2016-10-07 45 High School or Below male \n", | |
"1 2016-10-07 33 Bechalor female \n", | |
"2 2016-09-22 27 college male \n", | |
"3 2016-10-08 28 college female \n", | |
"4 2016-10-08 29 college male " | |
] | |
}, | |
"execution_count": 131, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"df['due_date'] = pd.to_datetime(df['due_date'])\n", | |
"df['effective_date'] = pd.to_datetime(df['effective_date'])\n", | |
"df.head()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"# Data visualization and pre-processing\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"Let’s see how many of each class is in our data set\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 132, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"PAIDOFF 260\n", | |
"COLLECTION 86\n", | |
"Name: loan_status, dtype: int64" | |
] | |
}, | |
"execution_count": 132, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"df['loan_status'].value_counts()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"260 people have paid off the loan on time while 86 have gone into collection\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Let's plot some columns to underestand data better:\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Collecting package metadata (current_repodata.json): ...working... done\n", | |
"Solving environment: ...working... done\n", | |
"\n", | |
"## Package Plan ##\n", | |
"\n", | |
" environment location: C:\\ProgramData\\Anaconda3\n", | |
"\n", | |
" added / updated specs:\n", | |
" - seaborn\n", | |
"\n", | |
"\n", | |
"The following packages will be UPDATED:\n", | |
"\n", | |
" conda pkgs/main::conda-4.7.12-py37_0 --> anaconda::conda-4.12.0-py37haa95532_0\n", | |
"\n", | |
"The following packages will be SUPERSEDED by a higher-priority channel:\n", | |
"\n", | |
" seaborn pkgs/main --> anaconda\n", | |
"\n", | |
"\n", | |
"Preparing transaction: ...working... done\n", | |
"Verifying transaction: ...working... failed\n" | |
] | |
}, | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"\n", | |
"\n", | |
"==> WARNING: A newer version of conda exists. <==\n", | |
" current version: 4.7.12\n", | |
" latest version: 4.13.0\n", | |
"\n", | |
"Please update conda by running\n", | |
"\n", | |
" $ conda update -n base -c defaults conda\n", | |
"\n", | |
"\n", | |
"\n", | |
"EnvironmentNotWritableError: The current user does not have write permissions to the target environment.\n", | |
" environment location: C:\\ProgramData\\Anaconda3\n", | |
"\n", | |
"\n" | |
] | |
} | |
], | |
"source": [ | |
"# notice: installing seaborn might takes a few minutes\n", | |
"!conda install -c anaconda seaborn -y" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 133, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAADQCAYAAABStPXYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAbjElEQVR4nO3de5wU5Z3v8c9XnBUVoiKjIogzIoqoZMBZjdclsLKo8XaMBuNR3HgO0WhcNvF4y3lpNr7WeCExyVGJuHLIJooasqBLEg1ROYqJF8ARwQshOuooIBA3xiAE8Hf+qJpJgz3MpXuma7q/79erXlP1VNVTv66ZZ35dT1c/pYjAzMwsa3YodQBmZmb5OEGZmVkmOUGZmVkmOUGZmVkmOUGZmVkmOUGZmVkmOUF1EUl7S7pP0uuSFkn6raQzi1T3aElzi1FXd5A0X1J9qeOw0iintiCpWtKzkl6QdHwXHufDrqq7J3GC6gKSBMwBnoyIAyLiCGACMKhE8exYiuOalWFbGAu8GhEjI+KpYsRkrXOC6hpjgL9ExA+bCyLizYj4PwCSekm6VdLzkpZI+nJaPjq92pgl6VVJ96YNHEnj07IFwH9rrlfSrpKmp3W9IOn0tPxCST+V9J/Arwp5MZJmSJoq6Yn0XfDfpcd8RdKMnO2mSlooaZmkf2mlrnHpO+jFaXx9ConNMq9s2oKkOuAW4GRJDZJ2bu3vWVKjpBvTdQsljZL0qKTfS7o43aaPpMfSfV9qjjfPcf9XzvnJ267KVkR4KvIEXA7ctp31k4D/nc7vBCwEaoHRwB9J3l3uAPwWOA7oDbwNDAUEPAjMTfe/Efjv6fzuwHJgV+BCoAno10oMTwENeaa/z7PtDOD+9NinAx8Ah6cxLgLq0u36pT97AfOBEenyfKAe6A88Ceyall8FXFfq35enrpvKsC1cCNyezrf69ww0Apek87cBS4C+QDXwXlq+I/CpnLpWAE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Y8/8ec/R0fP8KDBO0h7pu+RxaVkmuW24bRSge9pGKT4kLNUEjAbmpvMHAM8BK4CfAjul5b3T5RXp+gNKHHMdsBBYAswB9iDpf34M+F36s1+6rUgeFPl74CWSu4RKGfu/AK8CS4EfAztl9bwDM0k+D9hE8m7vos6cZ+BL6WtYAfxjqf/mO/D63Ta6N3a3jXYc20MdmZlZJpV9F5+ZmfVMTlBmZpZJTlBmZpZJTlBmZpZJTlBmZpZJTlAZJmmLpIZ0xOOfStqlle1+IWn3TtS/r6RZBcTXKKl/Z/c36yy3jcrg28wzTNKHEdEnnb8XWBQR381ZL5Lf4cet1dHF8TWSfM9hbSmOb5XLbaMy+Aqq53gKOFBSjZJn39wJLAb2a363lrPubiXPmvmVpJ0BJB0o6deSXpS0WNKQdPul6foLJT0k6RFJr0m6vvnAkuZIWpTWOakkr96sdW4bZcoJqgdIx986ieSb2QAHA/8eESMj4s1tNh8K3BERhwL/BZyVlt+bln+aZNyvfMO8HAmcR/IN/bMl1aflX4qII4B64HJJpR5J2Qxw2yh3TlDZtrOkBpLhXN4C7knL34yIZ1rZ542IaEjnFwE1kvoCAyNiNkBEbIiI9Xn2nRcR6yLiI5IBLI9Lyy+X9CLwDMmAj0MLfmVmhXHbqAA7tr2JldBHEVGXW5B0rfPn7eyzMWd+C7Az+Ye6z2fbDyRD0miS0ZePjoj1kuaTjA1mVkpuGxXAV1AVICI+AJoknQEgaadW7no6UVK/tG/+DOBpkqH9308b4DDgM90WuFkXc9vINieoynE+SXfEEuA3wD55tllAMrJyA/CziFgIPALsmO53A0lXhlk5cdvIKN9mbkBypxLJbbGXlToWsyxx2ygdX0GZmVkm+QrKzMwyyVdQZmaWSU5QZmaWSU5QZmaWSU5QZmaWSU5QZmaWSf8f4sNmiIERDx0AAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<Figure size 432x216 with 2 Axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"import seaborn as sns\n", | |
"\n", | |
"bins = np.linspace(df.Principal.min(), df.Principal.max(), 10)\n", | |
"g = sns.FacetGrid(df, col=\"Gender\", hue=\"loan_status\", palette=\"Set1\", col_wrap=2)\n", | |
"g.map(plt.hist, 'Principal', bins=bins, ec=\"k\")\n", | |
"\n", | |
"g.axes[-1].legend()\n", | |
"plt.show()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 134, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAADQCAYAAABStPXYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAZwElEQVR4nO3de5BU5bnv8e9PGB0UvKCjjIzAqCigkgFne0MNonLYXvF4iTsexTqecDReQkWPt5yyku0u463U5HiJJFpYiaKGbNBNKhpUOBETL4AjgniLDjoKcolGOQoRfM4fvWb2AA3TM6yZXt3z+1St6l5vr/X28zL98vR61+p3KSIwMzPLmu2KHYCZmVk+TlBmZpZJTlBmZpZJTlBmZpZJTlBmZpZJTlBmZpZJTlApk7SXpEckvSdpvqS/SDojpbpHS5qZRl1dQdIcSfXFjsOKq5z6hKQqSS9JelXSMZ34Pms6q+5S4gSVIkkCZgB/ioh9I+JQ4Fygpkjx9CzG+5o1K8M+cTzwZkSMiIjn04jJtswJKl1jgH9ExC+aCyJiaUT8HwBJPSTdJukVSQsl/c+kfHRytDFN0puSHk46NpLGJWVzgf/aXK+knSQ9mNT1qqTTk/ILJf1W0n8Af9yWxkiaIuk+SbOTb7/fTt5ziaQprba7T9I8SYsl/WQLdY1NvjkvSOLrvS2xWckomz4hqQ64FThJUoOkXlv6XEtqlHRT8to8SSMlP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xx4NWnPIuCGpHxf4GXgXeC3wA7FjrUDbRsNzCzl9iRxv5Ysi4EfJeWZ/7y5r5TG4n5S+OKpjszMLJMyP8RnZmbdkxOUmZllkhOUmZllkhOUmZllkhOUmZllkhOUmZllkhOUmZllkhNUGZA0I5mwcXHzpI2SLpL0tqQ5kn4p6e6kvErS7yS9kiyjihu9WddxXykt/qFuGZDUNyL+lkwH8wrwX4AXgJHAF8BzwGsRcZmkR4B7I2KupAHkpvfPNwGnWdlxXyktJTFZrLXpCklnJM/3Ac4H/m9E/A1A0m+BA5LXTwCGtZrhemdJfSLii64M2KxI3FdKiBNUiUum7j8BODIivkxmfH6L/LclgNyw7pER8VXXRGiWDe4rpcfnoErfLsCnSYcbQu52BDsC35a0m6SewJmttv8jcFnziqS6Lo3WrHjcV0qME1TpewroKWkhcCPwIvARcBO5u6k+A7wB/D3Z/gqgXtJCSW8AF3d9yGZF4b5SYnyRRJmS1Dsi1iTfCqcDD0bE9GLHZZY17ivZ5SOo8vVjSQ3k7qPzPjCjyPGYZZX7Skb5CMrMzDLJR1BmZpZJTlBmZpZJTlBmZpZJTlBmZpZJTlBmZpZJ/x8L0E1h/P2azQAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<Figure size 432x216 with 2 Axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"bins = np.linspace(df.age.min(), df.age.max(), 10)\n", | |
"g = sns.FacetGrid(df, col=\"Gender\", hue=\"loan_status\", palette=\"Set1\", col_wrap=2)\n", | |
"g.map(plt.hist, 'age', bins=bins, ec=\"k\")\n", | |
"\n", | |
"g.axes[-1].legend()\n", | |
"plt.show()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"# Pre-processing: Feature selection/extraction\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### Let's look at the day of the week people get the loan\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 135, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAADQCAYAAABStPXYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAZ+ElEQVR4nO3deZxU9bnn8c9XaC8quKO2dIBWEUTlNtjRuGAQEl8EN7wuMTEKGXMdjUsYw7glY3LjjHFhXBJXogZvRFxIxFxyo3GBCO4srYgY4lXEVlBgYoxRFPSZP+p0p4GCru4+1XWo+r5fr3p11alzfuc53fX0U+dXp34/RQRmZmZZs0WpAzAzM8vHBcrMzDLJBcrMzDLJBcrMzDLJBcrMzDLJBcrMzDLJBSplknaVdI+k1yXNlfSMpONTanuYpOlptNUZJM2UVF/qOKy0yiknJPWU9Jyk+ZKGFnE/Hxar7c2JC1SKJAmYBjwZEXtExAHAKUBNieLpWor9mjUpw5wYAbwaEYMjYlYaMdnGuUClazjwaUTc2rQgIt6MiJ8DSOoi6RpJL0h6SdJ/T5YPS842pkp6VdLkJLGRNDJZNhv4l6Z2JW0j6c6krfmSjkuWj5X0gKT/AP7QkYORNEnSLZJmJO9+v5zsc5GkSS3Wu0XSHEkLJf3bRto6MnnnPC+Jr3tHYrPNRtnkhKQ64GpglKQGSVtt7HUtaYmkK5Ln5kgaIukRSf8l6axkne6SHk+2XdAUb579/s8Wv5+8+VW2IsK3lG7A+cB1m3j+TOCHyf1/AuYAtcAw4K/k3lVuATwDHAZ0A94C+gEC7gemJ9tf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rnkGwqcD3wJGAg8lRsGjS2BZ8i9U90PeDRZ3gVY1qLd24D7I6JlIpqlzblSoVygSivfOFOTyM0e+qKkscAwgIh4SlJfSV8GukTEy0nStb6TiDXKjZz8beBp4CXgCGBPcu889wQejYhvtNxO0v7AwojY2DTNTwNHSPq/EbG6kFjM2sm5UoHcxVc6TwLHS9oqebd2TLK8B7As6TI4db1t/h2YAvwSICL+CvxFUlOXxGnAH8nvSWB88nMWcBbQELnBGJ8FDpW0F0DSl7838Cegp6SDk+VVkvZt0eYdwH8CD0jymx0rFudKhXKBKpFkSuv7gAZy897MSp76X+RmD30UeHW9zSYDO5BLvCZjgGskvQTUAT/ZyC5nAdXAMxHxLrC6aZ8RsQIYC0xJ2nkWGJBMK34icJWkF5NYD1nvOK4l1w3yK0l+PVnqnCuVy6OZb0YknQgcFxGnlToWsyxzrpQHn2puJiT9HPgaMKrUsZhlmXOlfPgMyszMMsn9oGZmlkkuUGZmlkkuUGZmlkkuUGZmlkkuUGZmlkn/H82S0fcuZqCmAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<Figure size 432x216 with 2 Axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"df['dayofweek'] = df['effective_date'].dt.dayofweek\n", | |
"bins = np.linspace(df.dayofweek.min(), df.dayofweek.max(), 10)\n", | |
"g = sns.FacetGrid(df, col=\"Gender\", hue=\"loan_status\", palette=\"Set1\", col_wrap=2)\n", | |
"g.map(plt.hist, 'dayofweek', bins=bins, ec=\"k\")\n", | |
"g.axes[-1].legend()\n", | |
"plt.show()\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"We see that people who get the loan at the end of the week don't pay it off, so let's use Feature binarization to set a threshold value less than day 4\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 136, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>Unnamed: 0</th>\n", | |
" <th>Unnamed: 0.1</th>\n", | |
" <th>loan_status</th>\n", | |
" <th>Principal</th>\n", | |
" <th>terms</th>\n", | |
" <th>effective_date</th>\n", | |
" <th>due_date</th>\n", | |
" <th>age</th>\n", | |
" <th>education</th>\n", | |
" <th>Gender</th>\n", | |
" <th>dayofweek</th>\n", | |
" <th>weekend</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>2016-09-08</td>\n", | |
" <td>2016-10-07</td>\n", | |
" <td>45</td>\n", | |
" <td>High School or Below</td>\n", | |
" <td>male</td>\n", | |
" <td>3</td>\n", | |
" <td>0</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>2</td>\n", | |
" <td>2</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>2016-09-08</td>\n", | |
" <td>2016-10-07</td>\n", | |
" <td>33</td>\n", | |
" <td>Bechalor</td>\n", | |
" <td>female</td>\n", | |
" <td>3</td>\n", | |
" <td>0</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>3</td>\n", | |
" <td>3</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>15</td>\n", | |
" <td>2016-09-08</td>\n", | |
" <td>2016-09-22</td>\n", | |
" <td>27</td>\n", | |
" <td>college</td>\n", | |
" <td>male</td>\n", | |
" <td>3</td>\n", | |
" <td>0</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>4</td>\n", | |
" <td>4</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>2016-09-09</td>\n", | |
" <td>2016-10-08</td>\n", | |
" <td>28</td>\n", | |
" <td>college</td>\n", | |
" <td>female</td>\n", | |
" <td>4</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4</th>\n", | |
" <td>6</td>\n", | |
" <td>6</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>2016-09-09</td>\n", | |
" <td>2016-10-08</td>\n", | |
" <td>29</td>\n", | |
" <td>college</td>\n", | |
" <td>male</td>\n", | |
" <td>4</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" Unnamed: 0 Unnamed: 0.1 loan_status Principal terms effective_date \\\n", | |
"0 0 0 PAIDOFF 1000 30 2016-09-08 \n", | |
"1 2 2 PAIDOFF 1000 30 2016-09-08 \n", | |
"2 3 3 PAIDOFF 1000 15 2016-09-08 \n", | |
"3 4 4 PAIDOFF 1000 30 2016-09-09 \n", | |
"4 6 6 PAIDOFF 1000 30 2016-09-09 \n", | |
"\n", | |
" due_date age education Gender dayofweek weekend \n", | |
"0 2016-10-07 45 High School or Below male 3 0 \n", | |
"1 2016-10-07 33 Bechalor female 3 0 \n", | |
"2 2016-09-22 27 college male 3 0 \n", | |
"3 2016-10-08 28 college female 4 1 \n", | |
"4 2016-10-08 29 college male 4 1 " | |
] | |
}, | |
"execution_count": 136, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"df['weekend'] = df['dayofweek'].apply(lambda x: 1 if (x>3) else 0)\n", | |
"df.head()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"## Convert Categorical features to numerical values\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"Let's look at gender:\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 137, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Gender loan_status\n", | |
"female PAIDOFF 0.865385\n", | |
" COLLECTION 0.134615\n", | |
"male PAIDOFF 0.731293\n", | |
" COLLECTION 0.268707\n", | |
"Name: loan_status, dtype: float64" | |
] | |
}, | |
"execution_count": 137, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"df.groupby(['Gender'])['loan_status'].value_counts(normalize=True)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"86 % of female pay there loans while only 73 % of males pay there loan\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"Let's convert male to 0 and female to 1:\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 138, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>Unnamed: 0</th>\n", | |
" <th>Unnamed: 0.1</th>\n", | |
" <th>loan_status</th>\n", | |
" <th>Principal</th>\n", | |
" <th>terms</th>\n", | |
" <th>effective_date</th>\n", | |
" <th>due_date</th>\n", | |
" <th>age</th>\n", | |
" <th>education</th>\n", | |
" <th>Gender</th>\n", | |
" <th>dayofweek</th>\n", | |
" <th>weekend</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>2016-09-08</td>\n", | |
" <td>2016-10-07</td>\n", | |
" <td>45</td>\n", | |
" <td>High School or Below</td>\n", | |
" <td>0</td>\n", | |
" <td>3</td>\n", | |
" <td>0</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>2</td>\n", | |
" <td>2</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>2016-09-08</td>\n", | |
" <td>2016-10-07</td>\n", | |
" <td>33</td>\n", | |
" <td>Bechalor</td>\n", | |
" <td>1</td>\n", | |
" <td>3</td>\n", | |
" <td>0</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>3</td>\n", | |
" <td>3</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>15</td>\n", | |
" <td>2016-09-08</td>\n", | |
" <td>2016-09-22</td>\n", | |
" <td>27</td>\n", | |
" <td>college</td>\n", | |
" <td>0</td>\n", | |
" <td>3</td>\n", | |
" <td>0</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>4</td>\n", | |
" <td>4</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>2016-09-09</td>\n", | |
" <td>2016-10-08</td>\n", | |
" <td>28</td>\n", | |
" <td>college</td>\n", | |
" <td>1</td>\n", | |
" <td>4</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4</th>\n", | |
" <td>6</td>\n", | |
" <td>6</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>2016-09-09</td>\n", | |
" <td>2016-10-08</td>\n", | |
" <td>29</td>\n", | |
" <td>college</td>\n", | |
" <td>0</td>\n", | |
" <td>4</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" Unnamed: 0 Unnamed: 0.1 loan_status Principal terms effective_date \\\n", | |
"0 0 0 PAIDOFF 1000 30 2016-09-08 \n", | |
"1 2 2 PAIDOFF 1000 30 2016-09-08 \n", | |
"2 3 3 PAIDOFF 1000 15 2016-09-08 \n", | |
"3 4 4 PAIDOFF 1000 30 2016-09-09 \n", | |
"4 6 6 PAIDOFF 1000 30 2016-09-09 \n", | |
"\n", | |
" due_date age education Gender dayofweek weekend \n", | |
"0 2016-10-07 45 High School or Below 0 3 0 \n", | |
"1 2016-10-07 33 Bechalor 1 3 0 \n", | |
"2 2016-09-22 27 college 0 3 0 \n", | |
"3 2016-10-08 28 college 1 4 1 \n", | |
"4 2016-10-08 29 college 0 4 1 " | |
] | |
}, | |
"execution_count": 138, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"df['Gender'].replace(to_replace=['male','female'], value=[0,1],inplace=True)\n", | |
"df.head()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"## One Hot Encoding\n", | |
"\n", | |
"#### How about education?\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 139, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"education loan_status\n", | |
"Bechalor PAIDOFF 0.750000\n", | |
" COLLECTION 0.250000\n", | |
"High School or Below PAIDOFF 0.741722\n", | |
" COLLECTION 0.258278\n", | |
"Master or Above COLLECTION 0.500000\n", | |
" PAIDOFF 0.500000\n", | |
"college PAIDOFF 0.765101\n", | |
" COLLECTION 0.234899\n", | |
"Name: loan_status, dtype: float64" | |
] | |
}, | |
"execution_count": 139, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"df.groupby(['education'])['loan_status'].value_counts(normalize=True)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Features before One Hot Encoding\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 140, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>Principal</th>\n", | |
" <th>terms</th>\n", | |
" <th>age</th>\n", | |
" <th>Gender</th>\n", | |
" <th>education</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>45</td>\n", | |
" <td>0</td>\n", | |
" <td>High School or Below</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>33</td>\n", | |
" <td>1</td>\n", | |
" <td>Bechalor</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>1000</td>\n", | |
" <td>15</td>\n", | |
" <td>27</td>\n", | |
" <td>0</td>\n", | |
" <td>college</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>28</td>\n", | |
" <td>1</td>\n", | |
" <td>college</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4</th>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>29</td>\n", | |
" <td>0</td>\n", | |
" <td>college</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" Principal terms age Gender education\n", | |
"0 1000 30 45 0 High School or Below\n", | |
"1 1000 30 33 1 Bechalor\n", | |
"2 1000 15 27 0 college\n", | |
"3 1000 30 28 1 college\n", | |
"4 1000 30 29 0 college" | |
] | |
}, | |
"execution_count": 140, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"df[['Principal','terms','age','Gender','education']].head()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Use one hot encoding technique to conver categorical varables to binary variables and append them to the feature Data Frame\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 141, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>Principal</th>\n", | |
" <th>terms</th>\n", | |
" <th>age</th>\n", | |
" <th>Gender</th>\n", | |
" <th>weekend</th>\n", | |
" <th>Bechalor</th>\n", | |
" <th>High School or Below</th>\n", | |
" <th>college</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>45</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>33</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>1000</td>\n", | |
" <td>15</td>\n", | |
" <td>27</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>28</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4</th>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>29</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" Principal terms age Gender weekend Bechalor High School or Below \\\n", | |
"0 1000 30 45 0 0 0 1 \n", | |
"1 1000 30 33 1 0 1 0 \n", | |
"2 1000 15 27 0 0 0 0 \n", | |
"3 1000 30 28 1 1 0 0 \n", | |
"4 1000 30 29 0 1 0 0 \n", | |
"\n", | |
" college \n", | |
"0 0 \n", | |
"1 0 \n", | |
"2 1 \n", | |
"3 1 \n", | |
"4 1 " | |
] | |
}, | |
"execution_count": 141, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"Feature = df[['Principal','terms','age','Gender','weekend']]\n", | |
"Feature = pd.concat([Feature,pd.get_dummies(df['education'])], axis=1)\n", | |
"Feature.drop(['Master or Above'], axis = 1,inplace=True)\n", | |
"Feature.head()\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### Feature Selection\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"Let's define feature sets, X:\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 142, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>Principal</th>\n", | |
" <th>terms</th>\n", | |
" <th>age</th>\n", | |
" <th>Gender</th>\n", | |
" <th>weekend</th>\n", | |
" <th>Bechalor</th>\n", | |
" <th>High School or Below</th>\n", | |
" <th>college</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>45</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>33</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>1000</td>\n", | |
" <td>15</td>\n", | |
" <td>27</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>28</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4</th>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>29</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" Principal terms age Gender weekend Bechalor High School or Below \\\n", | |
"0 1000 30 45 0 0 0 1 \n", | |
"1 1000 30 33 1 0 1 0 \n", | |
"2 1000 15 27 0 0 0 0 \n", | |
"3 1000 30 28 1 1 0 0 \n", | |
"4 1000 30 29 0 1 0 0 \n", | |
"\n", | |
" college \n", | |
"0 0 \n", | |
"1 0 \n", | |
"2 1 \n", | |
"3 1 \n", | |
"4 1 " | |
] | |
}, | |
"execution_count": 142, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"X = Feature\n", | |
"X[0:5]" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"What are our lables?\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 143, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"array(['PAIDOFF', 'PAIDOFF', 'PAIDOFF', 'PAIDOFF', 'PAIDOFF'],\n", | |
" dtype=object)" | |
] | |
}, | |
"execution_count": 143, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"y = df['loan_status'].values\n", | |
"y[0:5]" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"## Normalize Data\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"Data Standardization give data zero mean and unit variance (technically should be done after train test split)\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 144, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"array([[ 0.52, 0.92, 2.33, -0.42, -1.21, -0.38, 1.14, -0.87],\n", | |
" [ 0.52, 0.92, 0.34, 2.38, -1.21, 2.62, -0.88, -0.87],\n", | |
" [ 0.52, -0.96, -0.65, -0.42, -1.21, -0.38, -0.88, 1.15],\n", | |
" [ 0.52, 0.92, -0.49, 2.38, 0.83, -0.38, -0.88, 1.15],\n", | |
" [ 0.52, 0.92, -0.32, -0.42, 0.83, -0.38, -0.88, 1.15]])" | |
] | |
}, | |
"execution_count": 144, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"X= preprocessing.StandardScaler().fit(X).transform(X)\n", | |
"X[0:5]" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"# Classification\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"Now, it is your turn, use the training set to build an accurate model. Then use the test set to report the accuracy of the model\n", | |
"You should use the following algorithm:\n", | |
"\n", | |
"* K Nearest Neighbor(KNN)\n", | |
"* Decision Tree\n", | |
"* Support Vector Machine\n", | |
"* Logistic Regression\n", | |
"\n", | |
"\\__ Notice:\\__\n", | |
"\n", | |
"* You can go above and change the pre-processing, feature selection, feature-extraction, and so on, to make a better model.\n", | |
"* You should use either scikit-learn, Scipy or Numpy libraries for developing the classification algorithms.\n", | |
"* You should include the code of the algorithm in the following cells.\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# K Nearest Neighbor(KNN)\n", | |
"\n", | |
"Notice: You should find the best k to build the model with the best accuracy.\\\n", | |
"**warning:** You should not use the **loan_test.csv** for finding the best k, however, you can split your train_loan.csv into train and test to find the best **k**.\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 145, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Train set: (276, 8) (276,)\n", | |
"Test set: (70, 8) (70,)\n" | |
] | |
} | |
], | |
"source": [ | |
"from sklearn.model_selection import train_test_split\n", | |
"X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=0.2, random_state=0)\n", | |
"print ('Train set:', X_train.shape, y_train.shape)\n", | |
"print ('Test set:', X_test.shape, y_test.shape)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 146, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nOzdd3hUZfbA8e+ZnkpXUbqCgEgTAXtBir2giB0V0FUQLD/Ftq7uunapKiIg2EBFF7EiYlsLvUgTRBRBRHpJnfb+/pgJGzCBSebeKeF8nicPmcmde09Ccs/c9573vGKMQSmllEo1j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PJLXZbikc601pFBZCd4sRVAh1sv0HsBK4v9C8AXi4/RtJI2pcuok0/Qcpc3q97i5sv8z7XxTuMY1UGrwDSUNt77S9APgauLx4PC9+6Cmpd6l9D6k8ynOSbiscGk7FsqiH0190UCEcm4Wk6bF2s4Gr86KF74GHalzTDMyVtIWU7f3POn/WGZI2A3M4skBjNjBD0g5Sdvs5nVzbLOk7SdtJI5/3a5yzgaOnCAGwvZtU0O81SdfmOmTDSB1dCCdNZDMPoZvlEg/7bVvSPcBU23dUIK6RwFzb07s4705glO2nTk5kISTxDCqE7ncVaSGFSAsTZjY4HgBsb5O0UVLP8rtQJb1II8cQTqoYQYUQQqikeAYVQgihkqKDCiGEUEnRQYUQQqik6KBCCCFUUnRQIYQQKulf/PcLfJBNqFQAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<Figure size 432x288 with 1 Axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
}, | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"The best accuracy was with 0.7571428571428571 with k= 7\n" | |
] | |
} | |
], | |
"source": [ | |
"from sklearn.neighbors import KNeighborsClassifier\n", | |
"from sklearn import metrics\n", | |
"\n", | |
"Ks = 10\n", | |
"mean_acc = np.zeros((Ks-1))\n", | |
"std_acc = np.zeros((Ks-1))\n", | |
"\n", | |
"confusion = []\n", | |
"\n", | |
"for n in range(1,Ks): \n", | |
" neighbor = KNeighborsClassifier(n_neighbors = n).fit(X_train,y_train)\n", | |
" yhat=neighbor.predict(X_test)\n", | |
" mean_acc[n-1] = metrics.accuracy_score(y_test, yhat)\n", | |
"\n", | |
" \n", | |
" std_acc[n-1]=np.std(yhat==y_test)/np.sqrt(yhat.shape[0])\n", | |
"plt.plot(range(1,Ks),mean_acc,'g')\n", | |
"plt.fill_between(range(1,Ks),mean_acc-1 * std_acc, mean_acc+1*std_acc,alpha=0.10)\n", | |
"plt.legend(('Accuracy','std'))\n", | |
"plt.ylabel('Accuracy')\n", | |
"plt.xlabel('Neighbors (K)')\n", | |
"plt.tight_layout()\n", | |
"plt.show()\n", | |
"print( \"The best accuracy was with\", mean_acc.max(), \"with k=\", mean_acc.argmax()+1) " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 147, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"array(['COLLECTION', 'PAIDOFF', 'PAIDOFF', 'PAIDOFF', 'PAIDOFF'],\n", | |
" dtype=object)" | |
] | |
}, | |
"execution_count": 147, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"neighbor = KNeighborsClassifier(n_neighbors = 7).fit(X_train,y_train)\n", | |
"yhat = neighbor.predict(X_test)\n", | |
"yhat[0:5]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 148, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Train set Accuracy: 0.8007246376811594\n", | |
"Test set Accuracy: 0.7571428571428571\n" | |
] | |
} | |
], | |
"source": [ | |
"# accuracy of model\n", | |
"from sklearn import metrics\n", | |
"print(\"Train set Accuracy: \", metrics.accuracy_score(y_train, neighbor.predict(X_train)))\n", | |
"print(\"Test set Accuracy: \", metrics.accuracy_score(y_test, yhat))" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Decision Tree\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 149, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"from sklearn.tree import DecisionTreeClassifier\n", | |
"import sklearn.tree as tree" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 150, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"array(['COLLECTION', 'PAIDOFF', 'COLLECTION', 'PAIDOFF', 'PAIDOFF'],\n", | |
" dtype=object)" | |
] | |
}, | |
"execution_count": 150, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"dtree = DecisionTreeClassifier(criterion=\"entropy\", max_depth = 6).fit(X_train,y_train)\n", | |
"predTree = dtree.predict(X_test)\n", | |
"predTree[0:5]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 151, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Accuracy: 0.7285714285714285\n" | |
] | |
} | |
], | |
"source": [ | |
"print(\"Accuracy: \", metrics.accuracy_score(y_test, predTree))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 152, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"[Text(102.4603448275862, 201.90857142857143, 'X[4] <= -0.188\\nentropy = 0.839\\nsamples = 276\\nvalue = [74, 202]'),\n", | |
" Text(23.089655172413792, 170.84571428571428, 'X[7] <= 0.14\\nentropy = 0.181\\nsamples = 110\\nvalue = [3, 107]'),\n", | |
" Text(11.544827586206896, 139.78285714285715, 'entropy = 0.0\\nsamples = 67\\nvalue = [0, 67]'),\n", | |
" Text(34.63448275862069, 139.78285714285715, 'X[2] <= -0.902\\nentropy = 0.365\\nsamples = 43\\nvalue = [3, 40]'),\n", | |
" Text(23.089655172413792, 108.72, 'entropy = 0.0\\nsamples = 8\\nvalue = [0, 8]'),\n", | |
" Text(46.179310344827584, 108.72, 'X[2] <= -0.404\\nentropy = 0.422\\nsamples = 35\\nvalue = [3, 32]'),\n", | |
" Text(23.089655172413792, 77.65714285714284, 'X[1] <= -0.019\\nentropy = 0.619\\nsamples = 13\\nvalue = [2, 11]'),\n", | |
" Text(11.544827586206896, 46.59428571428572, 'entropy = 0.0\\nsamples = 8\\nvalue = [0, 8]'),\n", | |
" Text(34.63448275862069, 46.59428571428572, 'X[2] <= -0.653\\nentropy = 0.971\\nsamples = 5\\nvalue = [2, 3]'),\n", | |
" Text(23.089655172413792, 15.531428571428563, 'entropy = 1.0\\nsamples = 2\\nvalue = [1, 1]'),\n", | |
" Text(46.179310344827584, 15.531428571428563, 'entropy = 0.918\\nsamples = 3\\nvalue = [1, 2]'),\n", | |
" Text(69.26896551724138, 77.65714285714284, 'X[2] <= 1.254\\nentropy = 0.267\\nsamples = 22\\nvalue = [1, 21]'),\n", | |
" Text(57.72413793103448, 46.59428571428572, 'entropy = 0.0\\nsamples = 16\\nvalue = [0, 16]'),\n", | |
" Text(80.81379310344828, 46.59428571428572, 'X[2] <= 1.42\\nentropy = 0.65\\nsamples = 6\\nvalue = [1, 5]'),\n", | |
" Text(69.26896551724138, 15.531428571428563, 'entropy = 0.0\\nsamples = 1\\nvalue = [1, 0]'),\n", | |
" Text(92.35862068965517, 15.531428571428563, 'entropy = 0.0\\nsamples = 5\\nvalue = [0, 5]'),\n", | |
" Text(181.8310344827586, 170.84571428571428, 'X[1] <= -1.46\\nentropy = 0.985\\nsamples = 166\\nvalue = [71, 95]'),\n", | |
" Text(170.2862068965517, 139.78285714285715, 'entropy = 0.0\\nsamples = 7\\nvalue = [0, 7]'),\n", | |
" Text(193.37586206896552, 139.78285714285715, 'X[7] <= 0.14\\nentropy = 0.992\\nsamples = 159\\nvalue = [71, 88]'),\n", | |
" Text(138.53793103448277, 108.72, 'X[2] <= -1.565\\nentropy = 1.0\\nsamples = 87\\nvalue = [43, 44]'),\n", | |
" Text(126.99310344827586, 77.65714285714284, 'entropy = 0.0\\nsamples = 3\\nvalue = [0, 3]'),\n", | |
" Text(150.08275862068965, 77.65714285714284, 'X[2] <= -0.073\\nentropy = 1.0\\nsamples = 84\\nvalue = [43, 41]'),\n", | |
" Text(126.99310344827586, 46.59428571428572, 'X[5] <= 1.119\\nentropy = 0.979\\nsamples = 41\\nvalue = [24, 17]'),\n", | |
" Text(115.44827586206895, 15.531428571428563, 'entropy = 0.999\\nsamples = 33\\nvalue = [17, 16]'),\n", | |
" Text(138.53793103448277, 15.531428571428563, 'entropy = 0.544\\nsamples = 8\\nvalue = [7, 1]'),\n", | |
" Text(173.17241379310343, 46.59428571428572, 'X[3] <= 0.979\\nentropy = 0.99\\nsamples = 43\\nvalue = [19, 24]'),\n", | |
" Text(161.62758620689655, 15.531428571428563, 'entropy = 0.999\\nsamples = 37\\nvalue = [19, 18]'),\n", | |
" Text(184.71724137931034, 15.531428571428563, 'entropy = 0.0\\nsamples = 6\\nvalue = [0, 6]'),\n", | |
" Text(248.21379310344827, 108.72, 'X[2] <= 0.259\\nentropy = 0.964\\nsamples = 72\\nvalue = [28, 44]'),\n", | |
" Text(207.80689655172412, 77.65714285714284, 'X[2] <= -1.98\\nentropy = 0.992\\nsamples = 49\\nvalue = [22, 27]'),\n", | |
" Text(196.26206896551724, 46.59428571428572, 'entropy = 0.0\\nsamples = 1\\nvalue = [1, 0]'),\n", | |
" Text(219.35172413793103, 46.59428571428572, 'X[2] <= -1.648\\nentropy = 0.989\\nsamples = 48\\nvalue = [21, 27]'),\n", | |
" Text(207.80689655172412, 15.531428571428563, 'entropy = 0.0\\nsamples = 1\\nvalue = [0, 1]'),\n", | |
" Text(230.8965517241379, 15.531428571428563, 'entropy = 0.992\\nsamples = 47\\nvalue = [21, 26]'),\n", | |
" Text(288.6206896551724, 77.65714285714284, 'X[2] <= 0.922\\nentropy = 0.828\\nsamples = 23\\nvalue = [6, 17]'),\n", | |
" Text(265.5310344827586, 46.59428571428572, 'X[0] <= -0.399\\nentropy = 0.722\\nsamples = 15\\nvalue = [3, 12]'),\n", | |
" Text(253.98620689655172, 15.531428571428563, 'entropy = 0.0\\nsamples = 4\\nvalue = [0, 4]'),\n", | |
" Text(277.07586206896553, 15.531428571428563, 'entropy = 0.845\\nsamples = 11\\nvalue = [3, 8]'),\n", | |
" Text(311.7103448275862, 46.59428571428572, 'X[3] <= 0.979\\nentropy = 0.954\\nsamples = 8\\nvalue = [3, 5]'),\n", | |
" Text(300.1655172413793, 15.531428571428563, 'entropy = 0.863\\nsamples = 7\\nvalue = [2, 5]'),\n", | |
" Text(323.2551724137931, 15.531428571428563, 'entropy = 0.0\\nsamples = 1\\nvalue = [1, 0]')]" | |
] | |
}, | |
"execution_count": 152, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAV0AAADnCAYAAAC9roUQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO2de3iU5Zn/P3dCQiaACRBywABN6FASy6n0ACYWQqWYotaqVG3lUGt/7vbaYvdgt+3vt93662+73e122929artUJXiCcBALRmuL2tJEVJYg1SRCKkqRhBQyIIoJgXj//njfYAiZzExm3sMkz+e65rqY8M4z33ne572f+znczy2qisFgMBjcIcVrAQaDwTCcMEbXYDAYXMQYXYPBYHARY3QNBoPBRYzRNRgMBhcxRtdgMBhcxBhdg8FgcBFjdA0Gg8FFjNE1GAwGFzFG12AwGFzEGF2DwWBwEWN0DQaDwUWM0TUYDAYXMUbXYDAYXMQYXYPBYHARY3QNBoPBRYzRNRgMBhcxRtcnBAKBoyKiTrwCgcBRr3+fwWCwEJOuxx+IiEZzL1QVEYm1bFQ1tg8ZDAZHGOG1AMPF1NTUUFhYSEpKCi+88AJTpkxh8eLF1NTUUFxczJEjRygqKiI3N5f6+npSU1OZNWsWW7duZeTIkQA0NjZy9913e/xLDAZDX4yn6xP6erqhUIj29naCwSCNjY2UlpbGU7bxdA0Gn2CMrk/oMbpVVVUEg0E6OjoIhUJkZmZy9uxZxo8fT0tLCyNGjKCiooK2tjZCoRDl5eWsWbOGyspKnnvuOTIzMzl48CBTp04lOzub8vJyY3QNBh9hFtJ8xqpVq2hqaiItLY1Ro0bR3NyMiHDs2DEKCgrIy8ujtraWHTt2UF5eTl1dHWVlZYwePZqTJ0+Sl5fH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u7u7ycrKorm5mSVLlpCens7GjRvJyck5rz2RdXLw4EFaW1tJS0tLSJ2kp6eTkpLC3Llz2b59+4D3cTB1M2rUqPNlD/T8xFp2rM/9RZiFNLOQFq58s5DW/71M1gWpZNWdzM+9awtpBoPBYOgfs0/XYDAYXMQYXYPBYHARY3QNBoPBRYzRNRgMBhcxRtdgMBhcxBhdg8FgcBFjdA0Gg8FFjNE1GAwGFzFG12AwGFzEGF2DwWBwEWN0DQaDwUWM0TUYDAYXMUbXYDAYXMQYXYPBYHARY3QNBoPBRYzRNRgMBhcxRtdgMBhcxBhdg8FgcJH/D9s+AAr9wa4FAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<Figure size 432x288 with 1 Axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"tree.plot_tree(dtree)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Support Vector Machine\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 153, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"from sklearn.svm import SVC\n", | |
"from sklearn.metrics import confusion_matrix, classification_report" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 154, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"kernels = ['rbf','linear','poly','sigmoid']\n", | |
"acc = []\n", | |
"for i in kernels:\n", | |
" clf = SVC(kernel=i)\n", | |
" clf.fit(X_train,y_train)\n", | |
" yhat = clf.predict(X_test)\n", | |
" acc.append(metrics.accuracy_score(y_test,yhat)*100)\n", | |
"kernel = acc.index(max(acc))\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 155, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"clf = SVC(kernel = kernels[kernel])\n", | |
"clf.fit(X_train,y_train)\n", | |
"yhat = clf.predict(X_test)\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 158, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
" precision recall f1-score support\n", | |
"\n", | |
" COLLECTION 0.00 0.00 0.00 12\n", | |
" PAIDOFF 0.83 1.00 0.91 58\n", | |
"\n", | |
" accuracy 0.83 70\n", | |
" macro avg 0.41 0.50 0.45 70\n", | |
"weighted avg 0.69 0.83 0.75 70\n", | |
"\n" | |
] | |
}, | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"C:\\Users\\ankit\\AppData\\Roaming\\Python\\Python37\\site-packages\\sklearn\\metrics\\_classification.py:1248: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples. Use `zero_division` parameter to control this behavior.\n", | |
" _warn_prf(average, modifier, msg_start, len(result))\n", | |
"C:\\Users\\ankit\\AppData\\Roaming\\Python\\Python37\\site-packages\\sklearn\\metrics\\_classification.py:1248: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples. Use `zero_division` parameter to control this behavior.\n", | |
" _warn_prf(average, modifier, msg_start, len(result))\n", | |
"C:\\Users\\ankit\\AppData\\Roaming\\Python\\Python37\\site-packages\\sklearn\\metrics\\_classification.py:1248: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples. Use `zero_division` parameter to control this behavior.\n", | |
" _warn_prf(average, modifier, msg_start, len(result))\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"0.8285714285714286" | |
] | |
}, | |
"execution_count": 158, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAaMAAAEXCAYAAAAAziuXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly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2l5SV+r4z5mDeWWkVkNEfFWbmFcImm2fPjYiHhG0r7ADZImkSpWr9rOJQ4CRkraG5gO7BcR90i6O0+dvjGPG60E3JNbZpOB70fEg5JGAeOBl0ldiR35T9Kmdy+TxsCqk97TwN+AhYEfR8Qnks4hjSU9qHTzt4Dt6/vTMWscV2AwM7PCuZvOzMwK52RkZmaFczIyM7PCORmZmVnhnIzMzKxwTkZmZlY4JyMzMyvc/wN4jL4gnGwbRwAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<Figure size 432x288 with 2 Axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"import itertools\n", | |
"def plot_confusion_matrix(cm, classes,\n", | |
" normalize=False,\n", | |
" title='Confusion matrix',\n", | |
" cmap=plt.cm.Blues):\n", | |
"\n", | |
" if normalize:\n", | |
" cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n", | |
"\n", | |
" plt.imshow(cm, interpolation='nearest', cmap=cmap)\n", | |
" plt.title(title)\n", | |
" plt.colorbar()\n", | |
" tick_marks = np.arange(len(classes))\n", | |
" plt.xticks(tick_marks, classes, rotation=45)\n", | |
" plt.yticks(tick_marks, classes)\n", | |
"\n", | |
" fmt = '.2f' if normalize else 'd'\n", | |
" thresh = cm.max() / 2.\n", | |
" for i, j in itertools.product(range(cm.shape[0]), range(cm.shape[1])):\n", | |
" plt.text(j, i, format(cm[i, j], fmt),\n", | |
" horizontalalignment=\"center\",\n", | |
" color=\"white\" if cm[i, j] > thresh else \"black\")\n", | |
"\n", | |
" plt.tight_layout()\n", | |
" plt.ylabel('True label')\n", | |
" plt.xlabel('Predicted label')\n", | |
"cnf_matrix = confusion_matrix(y_test, yhat, labels=['PAIDOFF','COLLECTION'])\n", | |
"np.set_printoptions(precision=2)\n", | |
"\n", | |
"print (classification_report(y_test, yhat))\n", | |
"\n", | |
"plt.figure()\n", | |
"plot_confusion_matrix(cnf_matrix, classes=['PAIDOFF','COLLECTION'],normalize= False, title='Confusion matrix')\n", | |
"\n", | |
"f1_score(y_test, yhat, average='weighted')\n", | |
"\n", | |
"jaccard_score(y_test, yhat,pos_label='PAIDOFF')" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Logistic Regression\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 159, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"LogisticRegression(C=0.01, solver='liblinear')" | |
] | |
}, | |
"execution_count": 159, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"from sklearn.linear_model import LogisticRegression\n", | |
"from sklearn.model_selection import train_test_split\n", | |
"\n", | |
"\n", | |
"LogModel = LogisticRegression(C=0.01,solver='liblinear')\n", | |
"LogModel.fit(X_train,y_train)\n", | |
"LogModel" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 160, | |
"metadata": { | |
"scrolled": true | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"0.8" | |
] | |
}, | |
"execution_count": 160, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"yhat = LogModel.predict(X_test)\n", | |
"metrics.accuracy_score(y_test,yhat)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 161, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"array([[0.5 , 0.5 ],\n", | |
" [0.49, 0.51],\n", | |
" [0.49, 0.51],\n", | |
" [0.33, 0.67],\n", | |
" [0.49, 0.51],\n", | |
" [0.3 , 0.7 ],\n", | |
" [0.32, 0.68],\n", | |
" [0.46, 0.54],\n", | |
" [0.34, 0.66],\n", | |
" [0.42, 0.58],\n", | |
" [0.45, 0.55],\n", | |
" [0.3 , 0.7 ],\n", | |
" [0.46, 0.54],\n", | |
" [0.44, 0.56],\n", | |
" [0.35, 0.65],\n", | |
" [0.35, 0.65],\n", | |
" [0.46, 0.54],\n", | |
" [0.45, 0.55],\n", | |
" [0.27, 0.73],\n", | |
" [0.5 , 0.5 ],\n", | |
" [0.46, 0.54],\n", | |
" [0.47, 0.53],\n", | |
" [0.27, 0.73],\n", | |
" [0.34, 0.66],\n", | |
" [0.5 , 0.5 ],\n", | |
" [0.31, 0.69],\n", | |
" [0.5 , 0.5 ],\n", | |
" [0.47, 0.53],\n", | |
" [0.46, 0.54],\n", | |
" [0.46, 0.54],\n", | |
" [0.5 , 0.5 ],\n", | |
" [0.35, 0.65],\n", | |
" [0.35, 0.65],\n", | |
" [0.32, 0.68],\n", | |
" [0.46, 0.54],\n", | |
" [0.49, 0.51],\n", | |
" [0.49, 0.51],\n", | |
" [0.29, 0.71],\n", | |
" [0.31, 0.69],\n", | |
" [0.35, 0.65],\n", | |
" [0.49, 0.51],\n", | |
" [0.47, 0.53],\n", | |
" [0.3 , 0.7 ],\n", | |
" [0.45, 0.55],\n", | |
" [0.5 , 0.5 ],\n", | |
" [0.34, 0.66],\n", | |
" [0.5 , 0.5 ],\n", | |
" [0.44, 0.56],\n", | |
" [0.5 , 0.5 ],\n", | |
" [0.35, 0.65],\n", | |
" [0.34, 0.66],\n", | |
" [0.33, 0.67],\n", | |
" [0.3 , 0.7 ],\n", | |
" [0.5 , 0.5 ],\n", | |
" [0.31, 0.69],\n", | |
" [0.44, 0.56],\n", | |
" [0.34, 0.66],\n", | |
" [0.49, 0.51],\n", | |
" [0.5 , 0.5 ],\n", | |
" [0.26, 0.74],\n", | |
" [0.34, 0.66],\n", | |
" [0.45, 0.55],\n", | |
" [0.33, 0.67],\n", | |
" [0.49, 0.51],\n", | |
" [0.5 , 0.5 ],\n", | |
" [0.33, 0.67],\n", | |
" [0.33, 0.67],\n", | |
" [0.46, 0.54],\n", | |
" [0.5 , 0.5 ],\n", | |
" [0.31, 0.69]])" | |
] | |
}, | |
"execution_count": 161, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"yhat_prob = LogModel.predict_proba(X_test)\n", | |
"yhat_prob" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 162, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"0.5395716058447384\n" | |
] | |
} | |
], | |
"source": [ | |
"from sklearn.metrics import jaccard_score,log_loss\n", | |
"print(log_loss(y_test,yhat_prob))" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Model Evaluation using Test set\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 194, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"from sklearn.metrics import jaccard_score\n", | |
"from sklearn.metrics import f1_score\n", | |
"from sklearn.metrics import log_loss\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"First, download and load the test set:\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 195, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"--2022-06-02 16:54:58-- https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/ML0101ENv3/labs/loan_test.csv\n", | |
"Resolving s3-api.us-geo.objectstorage.softlayer.net (s3-api.us-geo.objectstorage.softlayer.net)... 67.228.254.196\n", | |
"Connecting to s3-api.us-geo.objectstorage.softlayer.net (s3-api.us-geo.objectstorage.softlayer.net)|67.228.254.196|:443... connected.\n", | |
"HTTP request sent, awaiting response... 200 OK\n", | |
"Length: 3642 (3.6K) [text/csv]\n", | |
"Saving to: 'loan_test.csv'\n", | |
"\n", | |
" 0K ... 100% 1.36G=0s\n", | |
"\n", | |
"2022-06-02 16:55:00 (1.36 GB/s) - 'loan_test.csv' saved [3642/3642]\n", | |
"\n" | |
] | |
} | |
], | |
"source": [ | |
"!wget -O loan_test.csv https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/ML0101ENv3/labs/loan_test.csv" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### Load Test set for evaluation\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 196, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>Unnamed: 0</th>\n", | |
" <th>Unnamed: 0.1</th>\n", | |
" <th>loan_status</th>\n", | |
" <th>Principal</th>\n", | |
" <th>terms</th>\n", | |
" <th>effective_date</th>\n", | |
" <th>due_date</th>\n", | |
" <th>age</th>\n", | |
" <th>education</th>\n", | |
" <th>Gender</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>9/8/2016</td>\n", | |
" <td>10/7/2016</td>\n", | |
" <td>50</td>\n", | |
" <td>Bechalor</td>\n", | |
" <td>female</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>5</td>\n", | |
" <td>5</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>300</td>\n", | |
" <td>7</td>\n", | |
" <td>9/9/2016</td>\n", | |
" <td>9/15/2016</td>\n", | |
" <td>35</td>\n", | |
" <td>Master or Above</td>\n", | |
" <td>male</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>21</td>\n", | |
" <td>21</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>9/10/2016</td>\n", | |
" <td>10/9/2016</td>\n", | |
" <td>43</td>\n", | |
" <td>High School or Below</td>\n", | |
" <td>female</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>24</td>\n", | |
" <td>24</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>1000</td>\n", | |
" <td>30</td>\n", | |
" <td>9/10/2016</td>\n", | |
" <td>10/9/2016</td>\n", | |
" <td>26</td>\n", | |
" <td>college</td>\n", | |
" <td>male</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4</th>\n", | |
" <td>35</td>\n", | |
" <td>35</td>\n", | |
" <td>PAIDOFF</td>\n", | |
" <td>800</td>\n", | |
" <td>15</td>\n", | |
" <td>9/11/2016</td>\n", | |
" <td>9/25/2016</td>\n", | |
" <td>29</td>\n", | |
" <td>Bechalor</td>\n", | |
" <td>male</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" Unnamed: 0 Unnamed: 0.1 loan_status Principal terms effective_date \\\n", | |
"0 1 1 PAIDOFF 1000 30 9/8/2016 \n", | |
"1 5 5 PAIDOFF 300 7 9/9/2016 \n", | |
"2 21 21 PAIDOFF 1000 30 9/10/2016 \n", | |
"3 24 24 PAIDOFF 1000 30 9/10/2016 \n", | |
"4 35 35 PAIDOFF 800 15 9/11/2016 \n", | |
"\n", | |
" due_date age education Gender \n", | |
"0 10/7/2016 50 Bechalor female \n", | |
"1 9/15/2016 35 Master or Above male \n", | |
"2 10/9/2016 43 High School or Below female \n", | |
"3 10/9/2016 26 college male \n", | |
"4 9/25/2016 29 Bechalor male " | |
] | |
}, | |
"execution_count": 196, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"test_df = pd.read_csv('https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/ML0101ENv3/labs/loan_test.csv')\n", | |
"test_df.head()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 197, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"array([[ 0.49, 0.93, 3.06, 1.98, -1.3 , 2.4 , -0.8 , -0.86],\n", | |
" [-3.56, -1.7 , 0.53, -0.51, 0.77, -0.42, -0.8 , -0.86],\n", | |
" [ 0.49, 0.93, 1.88, 1.98, 0.77, -0.42, 1.25, -0.86],\n", | |
" [ 0.49, 0.93, -0.98, -0.51, 0.77, -0.42, -0.8 , 1.16],\n", | |
" [-0.67, -0.79, -0.48, -0.51, 0.77, 2.4 , -0.8 , -0.86]])" | |
] | |
}, | |
"execution_count": 197, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"test_df['due_date'] = pd.to_datetime(test_df['due_date'])\n", | |
"test_df['effective_date'] = pd.to_datetime(test_df['effective_date'])\n", | |
"test_df['dayofweek'] = test_df['effective_date'].dt.dayofweek\n", | |
"test_df['weekend'] = test_df['dayofweek'].apply(lambda x: 1 if (x>3) else 0)\n", | |
"test_df['Gender'].replace(to_replace=['male','female'], value=[0,1],inplace=True)\n", | |
"\n", | |
"#These are the relevant columns\n", | |
"test_Feature = test_df[['Principal','terms','age','Gender','weekend']]\n", | |
"test_Feature = pd.concat([test_Feature,pd.get_dummies(test_df['education'])], axis=1)\n", | |
"test_Feature.drop(['Master or Above'], axis = 1,inplace=True)\n", | |
"\n", | |
"#Including variable for these columns\n", | |
"test_X = preprocessing.StandardScaler().fit(test_Feature).transform(test_Feature)\n", | |
"test_X[0:5]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 198, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"array(['PAIDOFF', 'PAIDOFF', 'PAIDOFF', 'PAIDOFF', 'PAIDOFF'],\n", | |
" dtype=object)" | |
] | |
}, | |
"execution_count": 198, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"test_y = test_df['loan_status'].values\n", | |
"test_y[0:5]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 202, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>Jaccard</th>\n", | |
" <th>F1-score</th>\n", | |
" <th>LogLoss</th>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>Algorithm</th>\n", | |
" <th></th>\n", | |
" <th></th>\n", | |
" <th></th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>KNN</th>\n", | |
" <td>0.700000</td>\n", | |
" <td>0.744246</td>\n", | |
" <td>NA</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>Decision Tree</th>\n", | |
" <td>0.717391</td>\n", | |
" <td>0.756632</td>\n", | |
" <td>NA</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>SVM</th>\n", | |
" <td>0.740741</td>\n", | |
" <td>0.851064</td>\n", | |
" <td>NA</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>Logistic Regresssion</th>\n", | |
" <td>0.740741</td>\n", | |
" <td>0.851064</td>\n", | |
" <td>0.576632</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" Jaccard F1-score LogLoss\n", | |
"Algorithm \n", | |
"KNN 0.700000 0.744246 NA\n", | |
"Decision Tree 0.717391 0.756632 NA\n", | |
"SVM 0.740741 0.851064 NA\n", | |
"Logistic Regresssion 0.740741 0.851064 0.576632" | |
] | |
}, | |
"execution_count": 202, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"knn = neighbor.predict(test_X)\n", | |
"decision = dtree.predict(test_X)\n", | |
"svm = clf.predict(test_X)\n", | |
"log = LogModel.predict(test_X)\n", | |
"\n", | |
"Algorithm = ['KNN','Decision Tree','SVM','Logistic Regresssion']\n", | |
"\n", | |
"Jaccard = [jaccard_score(knn,test_y,pos_label='PAIDOFF'),\n", | |
" jaccard_score(decision,test_y,pos_label='PAIDOFF'),\n", | |
" jaccard_score(svm,test_y,pos_label='PAIDOFF'),\n", | |
" jaccard_score(log,test_y,pos_label='PAIDOFF')]\n", | |
"\n", | |
"F1_score = [f1_score(knn,test_y,average='weighted'),\n", | |
" f1_score(decision,test_y,average='weighted'),\n", | |
" f1_score(svm,test_y,average='weighted'),\n", | |
" f1_score(log,test_y,average='weighted')]\n", | |
"\n", | |
"dict = {'Algorithm':Algorithm,\n", | |
" 'Jaccard':Jaccard,\n", | |
" 'F1-score':F1_score}\n", | |
"\n", | |
"logProba = LogModel.predict_proba(test_X)\n", | |
"logLoss = log_loss(test_y,logProba)\n", | |
"\n", | |
"df = pd.DataFrame(dict)\n", | |
"df['LogLoss'] = ['NA','NA','NA',logLoss]\n", | |
"df.set_index('Algorithm',inplace=True)\n", | |
"df" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Report\n", | |
"\n", | |
"You should be able to report the accuracy of the built model using different evaluation metrics:\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"| Algorithm | Jaccard | F1-score | LogLoss |\n", | |
"| ------------------ | ------- | -------- | ------- |\n", | |
"| KNN | ? | ? | NA |\n", | |
"| Decision Tree | ? | ? | NA |\n", | |
"| SVM | ? | ? | NA |\n", | |
"| LogisticRegression | ? | ? | ? |\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"<h2>Want to learn more?</h2>\n", | |
"\n", | |
"IBM SPSS Modeler is a comprehensive analytics platform that has many machine learning algorithms. It has been designed to bring predictive intelligence to decisions made by individuals, by groups, by systems – by your enterprise as a whole. A free trial is available through this course, available here: <a href=\"http://cocl.us/ML0101EN-SPSSModeler?utm_medium=Exinfluencer&utm_source=Exinfluencer&utm_content=000026UJ&utm_term=10006555&utm_id=NA-SkillsNetwork-Channel-SkillsNetworkCoursesIBMDeveloperSkillsNetworkML0101ENSkillsNetwork20718538-2022-01-01\">SPSS Modeler</a>\n", | |
"\n", | |
"Also, you can use Watson Studio to run these notebooks faster with bigger datasets. Watson Studio is IBM's leading cloud solution for data scientists, built by data scientists. With Jupyter notebooks, RStudio, Apache Spark and popular libraries pre-packaged in the cloud, Watson Studio enables data scientists to collaborate on their projects without having to install anything. Join the fast-growing community of Watson Studio users today with a free account at <a href=\"https://cocl.us/ML0101EN_DSX?utm_medium=Exinfluencer&utm_source=Exinfluencer&utm_content=000026UJ&utm_term=10006555&utm_id=NA-SkillsNetwork-Channel-SkillsNetworkCoursesIBMDeveloperSkillsNetworkML0101ENSkillsNetwork20718538-2022-01-01\">Watson Studio</a>\n", | |
"\n", | |
"<h3>Thanks for completing this lesson!</h3>\n", | |
"\n", | |
"<h4>Author: <a href=\"https://ca.linkedin.com/in/saeedaghabozorgi?utm_medium=Exinfluencer&utm_source=Exinfluencer&utm_content=000026UJ&utm_term=10006555&utm_id=NA-SkillsNetwork-Channel-SkillsNetworkCoursesIBMDeveloperSkillsNetworkML0101ENSkillsNetwork20718538-2022-01-01?utm_medium=Exinfluencer&utm_source=Exinfluencer&utm_content=000026UJ&utm_term=10006555&utm_id=NA-SkillsNetwork-Channel-SkillsNetworkCoursesIBMDeveloperSkillsNetworkML0101ENSkillsNetwork20718538-2022-01-01\">Saeed Aghabozorgi</a></h4>\n", | |
"<p><a href=\"https://ca.linkedin.com/in/saeedaghabozorgi\">Saeed Aghabozorgi</a>, PhD is a Data Scientist in IBM with a track record of developing enterprise level applications that substantially increases clients’ ability to turn data into actionable knowledge. He is a researcher in data mining field and expert in developing advanced analytic methods like machine learning and statistical modelling on large datasets.</p>\n", | |
"\n", | |
"<hr>\n", | |
"\n", | |
"## Change Log\n", | |
"\n", | |
"| Date (YYYY-MM-DD) | Version | Changed By | Change Description |\n", | |
"| ----------------- | ------- | ------------- | ------------------------------------------------------------------------------ |\n", | |
"| 2020-10-27 | 2.1 | Lakshmi Holla | Made changes in import statement due to updates in version of sklearn library |\n", | |
"| 2020-08-27 | 2.0 | Malika Singla | Added lab to GitLab |\n", | |
"\n", | |
"<hr>\n", | |
"\n", | |
"## <h3 align=\"center\"> © IBM Corporation 2020. All rights reserved. <h3/>\n", | |
"\n", | |
"<p>\n" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment