{ "cells": [ { "cell_type": "markdown", "id": "b4fbf4da", "metadata": { "papermill": { "duration": 0.073094, "end_time": "2022-01-23T20:23:35.216134", "exception": false, "start_time": "2022-01-23T20:23:35.143040", "status": "completed" }, "tags": [] }, "source": [ "## Kaggle Titanic Dataset - Prediction of Survival" ] }, { "cell_type": "code", "execution_count": 1, "id": "2c390dde", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:35.368467Z", "iopub.status.busy": "2022-01-23T20:23:35.367848Z", "iopub.status.idle": "2022-01-23T20:23:36.318496Z", "shell.execute_reply": "2022-01-23T20:23:36.318937Z", "shell.execute_reply.started": "2022-01-23T20:21:24.528617Z" }, "papermill": { "duration": 1.033407, "end_time": "2022-01-23T20:23:36.319267", "exception": false, "start_time": "2022-01-23T20:23:35.285860", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "id": "7bfd8b6e", "metadata": { "papermill": { "duration": 0.067688, "end_time": "2022-01-23T20:23:36.453753", "exception": false, "start_time": "2022-01-23T20:23:36.386065", "status": "completed" }, "tags": [] }, "source": [ "### Read Data" ] }, { "cell_type": "code", "execution_count": 3, "id": "1cabca22", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:36.592363Z", "iopub.status.busy": "2022-01-23T20:23:36.591709Z", "iopub.status.idle": "2022-01-23T20:23:36.628567Z", "shell.execute_reply": "2022-01-23T20:23:36.628091Z", "shell.execute_reply.started": "2022-01-23T20:21:24.537862Z" }, "papermill": { "duration": 0.108169, "end_time": "2022-01-23T20:23:36.628689", "exception": false, "start_time": "2022-01-23T20:23:36.520520", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarked
0103Braund, Mr. Owen Harrismale22.010A/5 211717.2500NaNS
1211Cumings, Mrs. John Bradley (Florence Briggs Th...female38.010PC 1759971.2833C85C
2313Heikkinen, Miss. Lainafemale26.000STON/O2. 31012827.9250NaNS
3411Futrelle, Mrs. Jacques Heath (Lily May Peel)female35.01011380353.1000C123S
4503Allen, Mr. William Henrymale35.0003734508.0500NaNS
\n", "
" ], "text/plain": [ " PassengerId Survived Pclass \\\n", "0 1 0 3 \n", "1 2 1 1 \n", "2 3 1 3 \n", "3 4 1 1 \n", "4 5 0 3 \n", "\n", " Name Sex Age SibSp \\\n", "0 Braund, Mr. Owen Harris male 22.0 1 \n", "1 Cumings, Mrs. John Bradley (Florence Briggs Th... female 38.0 1 \n", "2 Heikkinen, Miss. Laina female 26.0 0 \n", "3 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35.0 1 \n", "4 Allen, Mr. William Henry male 35.0 0 \n", "\n", " Parch Ticket Fare Cabin Embarked \n", "0 0 A/5 21171 7.2500 NaN S \n", "1 0 PC 17599 71.2833 C85 C \n", "2 0 STON/O2. 3101282 7.9250 NaN S \n", "3 0 113803 53.1000 C123 S \n", "4 0 373450 8.0500 NaN S " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfTR = pd.read_csv('./Data/train.csv')\n", "dfTR.head()" ] }, { "cell_type": "code", "execution_count": null, "id": "300ce6a2", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 18, "id": "76688ea8", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:36.783711Z", "iopub.status.busy": "2022-01-23T20:23:36.782953Z", "iopub.status.idle": "2022-01-23T20:23:36.787836Z", "shell.execute_reply": "2022-01-23T20:23:36.787060Z", "shell.execute_reply.started": "2022-01-23T20:21:24.589046Z" }, "papermill": { "duration": 0.091923, "end_time": "2022-01-23T20:23:36.788030", "exception": false, "start_time": "2022-01-23T20:23:36.696107", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 891 entries, 0 to 890\n", "Data columns (total 12 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 PassengerId 891 non-null int64 \n", " 1 Survived 891 non-null int64 \n", " 2 Pclass 891 non-null int64 \n", " 3 Name 891 non-null object \n", " 4 Sex 891 non-null object \n", " 5 Age 714 non-null float64\n", " 6 SibSp 891 non-null int64 \n", " 7 Parch 891 non-null int64 \n", " 8 Ticket 891 non-null object \n", " 9 Fare 891 non-null float64\n", " 10 Cabin 204 non-null object \n", " 11 Embarked 889 non-null object \n", "dtypes: float64(2), int64(5), object(5)\n", "memory usage: 83.7+ KB\n" ] } ], "source": [ "## Show dataframe info\n", "dfTR.info()" ] }, { "cell_type": "code", "execution_count": 19, "id": "1465df14", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:36.934356Z", "iopub.status.busy": "2022-01-23T20:23:36.933727Z", "iopub.status.idle": "2022-01-23T20:23:36.957917Z", "shell.execute_reply": "2022-01-23T20:23:36.958453Z", "shell.execute_reply.started": "2022-01-23T20:21:24.614343Z" }, "papermill": { "duration": 0.101529, "end_time": "2022-01-23T20:23:36.958616", "exception": false, "start_time": "2022-01-23T20:23:36.857087", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PassengerIdSurvivedPclassAgeSibSpParchFare
count891.000000891.000000891.000000714.000000891.000000891.000000891.000000
mean446.0000000.3838382.30864229.6991180.5230080.38159432.204208
std257.3538420.4865920.83607114.5264971.1027430.80605749.693429
min1.0000000.0000001.0000000.4200000.0000000.0000000.000000
25%223.5000000.0000002.00000020.1250000.0000000.0000007.910400
50%446.0000000.0000003.00000028.0000000.0000000.00000014.454200
75%668.5000001.0000003.00000038.0000001.0000000.00000031.000000
max891.0000001.0000003.00000080.0000008.0000006.000000512.329200
\n", "
" ], "text/plain": [ " PassengerId Survived Pclass Age SibSp \\\n", "count 891.000000 891.000000 891.000000 714.000000 891.000000 \n", "mean 446.000000 0.383838 2.308642 29.699118 0.523008 \n", "std 257.353842 0.486592 0.836071 14.526497 1.102743 \n", "min 1.000000 0.000000 1.000000 0.420000 0.000000 \n", "25% 223.500000 0.000000 2.000000 20.125000 0.000000 \n", "50% 446.000000 0.000000 3.000000 28.000000 0.000000 \n", "75% 668.500000 1.000000 3.000000 38.000000 1.000000 \n", "max 891.000000 1.000000 3.000000 80.000000 8.000000 \n", "\n", " Parch Fare \n", "count 891.000000 891.000000 \n", "mean 0.381594 32.204208 \n", "std 0.806057 49.693429 \n", "min 0.000000 0.000000 \n", "25% 0.000000 7.910400 \n", "50% 0.000000 14.454200 \n", "75% 0.000000 31.000000 \n", "max 6.000000 512.329200 " ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Show dataframe description\n", "dfTR.describe()" ] }, { "cell_type": "markdown", "id": "febef6d7", "metadata": { "papermill": { "duration": 0.067961, "end_time": "2022-01-23T20:23:37.778277", "exception": false, "start_time": "2022-01-23T20:23:37.710316", "status": "completed" }, "tags": [] }, "source": [ "### Clean Data" ] }, { "cell_type": "code", "execution_count": 20, "id": "1ecb5dc5", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "PassengerId 0\n", "Survived 0\n", "Pclass 0\n", "Name 0\n", "Sex 0\n", "Age 177\n", "SibSp 0\n", "Parch 0\n", "Ticket 0\n", "Fare 0\n", "Cabin 687\n", "Embarked 2\n", "dtype: int64" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Show dataframe null counts\n", "dfTR.isnull().sum()" ] }, { "cell_type": "code", "execution_count": 21, "id": "54c9c2f0", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['PassengerId', 'Survived', 'Pclass', 'Name', 'Sex', 'Age', 'SibSp',\n", " 'Parch', 'Ticket', 'Fare', 'Cabin', 'Embarked'],\n", " dtype='object')" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfTR.columns" ] }, { "cell_type": "code", "execution_count": 22, "id": "d8071979", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarked
0103Braund, Mr. Owen Harrismale22.010A/5 211717.2500NaNS
1211Cumings, Mrs. John Bradley (Florence Briggs Th...female38.010PC 1759971.2833C85C
2313Heikkinen, Miss. Lainafemale26.000STON/O2. 31012827.9250NaNS
3411Futrelle, Mrs. Jacques Heath (Lily May Peel)female35.01011380353.1000C123S
4503Allen, Mr. William Henrymale35.0003734508.0500NaNS
\n", "
" ], "text/plain": [ " PassengerId Survived Pclass \\\n", "0 1 0 3 \n", "1 2 1 1 \n", "2 3 1 3 \n", "3 4 1 1 \n", "4 5 0 3 \n", "\n", " Name Sex Age SibSp \\\n", "0 Braund, Mr. Owen Harris male 22.0 1 \n", "1 Cumings, Mrs. John Bradley (Florence Briggs Th... female 38.0 1 \n", "2 Heikkinen, Miss. Laina female 26.0 0 \n", "3 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35.0 1 \n", "4 Allen, Mr. William Henry male 35.0 0 \n", "\n", " Parch Ticket Fare Cabin Embarked \n", "0 0 A/5 21171 7.2500 NaN S \n", "1 0 PC 17599 71.2833 C85 C \n", "2 0 STON/O2. 3101282 7.9250 NaN S \n", "3 0 113803 53.1000 C123 S \n", "4 0 373450 8.0500 NaN S " ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfTR.head()" ] }, { "cell_type": "code", "execution_count": 25, "id": "ec040176", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
SurvivedPclassSexAgeSibSpParchFareEmbarked
003male22.0107.2500S
111female38.01071.2833C
213female26.0007.9250S
311female35.01053.1000S
403male35.0008.0500S
\n", "
" ], "text/plain": [ " Survived Pclass Sex Age SibSp Parch Fare Embarked\n", "0 0 3 male 22.0 1 0 7.2500 S\n", "1 1 1 female 38.0 1 0 71.2833 C\n", "2 1 3 female 26.0 0 0 7.9250 S\n", "3 1 1 female 35.0 1 0 53.1000 S\n", "4 0 3 male 35.0 0 0 8.0500 S" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Select columns\n", "SEL_COLS = ['Survived', 'Pclass', 'Sex', 'Age', 'SibSp', 'Parch', 'Fare', 'Embarked']\n", "dfTR = dfTR[SEL_COLS]\n", "dfTR.head()" ] }, { "cell_type": "code", "execution_count": 31, "id": "9027e143", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(712, 8)" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Drop NAs\n", "dfTR = dfTR.dropna()\n", "dfTR.shape" ] }, { "cell_type": "code", "execution_count": 39, "id": "54b1d303", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PclassSexAgeSibSpParchFareEmbarked
Survived
0424424424424424424424
1288288288288288288288
\n", "
" ], "text/plain": [ " Pclass Sex Age SibSp Parch Fare Embarked\n", "Survived \n", "0 424 424 424 424 424 424 424\n", "1 288 288 288 288 288 288 288" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## View distributions\n", "SEL_VAR = SEL_COLS[0] ## Change index for other variables\n", "dfTR.groupby(SEL_VAR).count()" ] }, { "cell_type": "markdown", "id": "40f4df45", "metadata": { "papermill": { "duration": 0.067961, "end_time": "2022-01-23T20:23:37.778277", "exception": false, "start_time": "2022-01-23T20:23:37.710316", "status": "completed" }, "tags": [] }, "source": [ "### Visualize Data" ] }, { "cell_type": "markdown", "id": "05add9c6", "metadata": { "papermill": { "duration": 0.074725, "end_time": "2022-01-23T20:23:39.393811", "exception": false, "start_time": "2022-01-23T20:23:39.319086", "status": "completed" }, "tags": [] }, "source": [ " #### Survival counts" ] }, { "cell_type": "code", "execution_count": 41, "id": "76379c89", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:38.059072Z", "iopub.status.busy": "2022-01-23T20:23:38.058400Z", "iopub.status.idle": "2022-01-23T20:23:38.223899Z", "shell.execute_reply": "2022-01-23T20:23:38.224572Z", "shell.execute_reply.started": "2022-01-23T20:21:24.939241Z" }, "papermill": { "duration": 0.240324, "end_time": "2022-01-23T20:23:38.224750", "exception": false, "start_time": "2022-01-23T20:23:37.984426", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEGCAYAAACKB4k+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAATsklEQVR4nO3df7BcZX3H8ff1GgOR6JXhgiGJDWr8TgNqrJRa+aMUpINTNGhLGhRJS4byRxSZoXUAZ5SWyZSZIpaxwIhKDVYN8QclZShRYymlFQI4CCTwrYxEvCYSfl0Ro9Fsbv/Yk4eV3B8bN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EAvH+fP5T0IhkKEhwCrI6IzRFxP817VV8C/B1wZUT8N81DVSfzVZpf4msn6XMDcGb1uMf7gRUR8T1gE8/fCvXDwMqIuBt45b59HOnF8yqpkqTCPQVJUmEoSJIKQ0GSVBgKkqTCUJAkFYaCJKkwFCRJxf8DMXFdfmtDKacAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "sns.countplot(data = dfTR, x='Survived')\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": 42, "id": "115df154", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:38.514026Z", "iopub.status.busy": "2022-01-23T20:23:38.513415Z", "iopub.status.idle": "2022-01-23T20:23:38.697027Z", "shell.execute_reply": "2022-01-23T20:23:38.697463Z", "shell.execute_reply.started": "2022-01-23T20:21:25.121588Z" }, "papermill": { "duration": 0.25888, "end_time": "2022-01-23T20:23:38.697629", "exception": false, "start_time": "2022-01-23T20:23:38.438749", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEGCAYAAACKB4k+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAZrUlEQVR4nO3de5RcZZnv8W+ncmkSAh0mDSQQSALh8XARhBB1WHNkZHQxs1TUGThBR/AQkeUKoMgBMR4BhcgtXBWUWyAgkARGNCIHRDyMchTQoHJ/lEtgQmK4JUJICOlKnT+qsmlIp+kkXV2d7u9nrayu/dZ+dz1VK12/fvfl3U2VSgVJkgAGNLoASVLvYShIkgqGgiSpYChIkgqGgiSpMLDRBWyKNWvWVMplz56SpA0xaFDpJaC1o+c261AolyssW7ai0WVI0maltXX4s+t7zt1HkqSCoSBJKhgKkqTCZn1MQZLWKpfbWLr0Rdra3mx0Kb3GwIGDGTGil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S6Jr6Oqe5kCQVHClIkgqGgiSpYChIkgqGgiSpYChIkgpepyABEfENqtdnlIE1wDGZef8mbvMTwO7dMetsRCzPzC03dTvSuzEU1O9FxAepTs+8b2auioiRwOAu9h1Yu9ZjHZk5D5jXfZVK9WcoSDAKeCkzVwFk5ksAEbEAmJiZL0XERGBGZh4YEacDo4GxwEsRsQtw1NqL/iLiHuBEYC9gIvAN4E/A+MxcExFDgQTGAztRnbq8FVgBHJ2ZT9SuML+R6u/oHXX/BKQajylI8HNgTET8OSIui4gPdaHPfsAhmfkZqtONHwYQEaOA0Zk5f+2Kmfk3qqGwdrsfB+7MzNXAFcBxmbkf8L+Ay2rrXAx8PzP3B/66ye9Q6iJDQf1eZi6n+iX/ReBFYE5EfP5dus3LzJW1x3OBQ2uPDwNu7mD9OcD/qD2eXHuNLYG/B26OiD8Cl1MdtQAcANxUe3z9hrwfaVO4+0gCMrMM3APcExEPA0cCbbz1h1PzO7q83q7v8xHxckS8l+oX/zEdvMQ84KyI2IZqAP0SGAYsy8x91lOWc9CoxzlSUL8XVRPaNe0DPAssoPoFDvCv77KZ2cDJwNaZ+fA7n6yNRh6gulvotswsZ+arwDMRcWitjqaI2LvW5f9RHVEAfHaD35S0kQwFCbYEZkXEYxHxENV7VZ8OfAu4OCJ+TfVU1c7cQvVLfG4n68wB/r32c63PAlMi4k/Ao7x1K9QvA1Mj4nfA1hv2dqSN5yypkqSCIwVJUsFQkCQVDAVJUsFQkCQVDAVJUsFQkCQVDAVJUuH/AzVuwHrBylzwAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "sns.countplot(data=dfTR, x='Survived', hue='Sex')\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": 43, "id": "7532cae2", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:39.030170Z", "iopub.status.busy": "2022-01-23T20:23:39.029196Z", "iopub.status.idle": "2022-01-23T20:23:39.239533Z", "shell.execute_reply": "2022-01-23T20:23:39.238714Z", "shell.execute_reply.started": "2022-01-23T20:21:25.320915Z" }, "papermill": { "duration": 0.306993, "end_time": "2022-01-23T20:23:39.239736", "exception": false, "start_time": "2022-01-23T20:23:38.932743", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEGCAYAAACKB4k+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAXr0lEQVR4nO3dbVBU58HG8WtZQKwaFAxgkYfEETWNL3Faa/C1WYsIq4HBklYTNMSOE2pQQ8cKTWUap5oYp1bH1kTGfKAZG81QCtYVtTDxZewkzEQnaEZTTYcGHNm1vBg1ioD7fPDJ/WgUXGSXBfn/PsHhnPtcZCZenHPuPbfF7Xa7BQCApAB/BwAA9ByUAgDAoBQAAAalAAAwKAUAgBHo7wBdMXnyZEVHR/s7BgD0KufPn9fHH398z5/16lKIjo5WcXGxv2MAQK+SlpbW7s+4fQQAMCgFAIBBKQAAjF79TAEA/KWlpUW1tbW6fv26v6O0KyQkRMOHD1dQUJDHx1AKAPAAamtrNWjQID322GOyWCz+jnMXt9ut+vp61dbW6vHHH/f4OG4fAcADuH79usLDw3tkIUiSxWJReHh4p69kKAUAeEA9tRC+8SD5KAUAgMEzBQDwoieeeEKjRo1SW1ubRowYoQ0bNqh///733Hfr1q36zne+oyVLlnRzyvZxpQCfa25t9neETuuNmdEzhISEqLS0VHv37lVQUJB27drl70idwpUCfK5fYD9N3TrV3zE65Vj2MX9HwEPgBz/4gT7//HNJUklJid59911ZLBaNHj1aGzduvGPfDz74QLt371ZLS4tiY2P11ltvqX///iorK9Of/vQnBQQEaNCgQdq5c6fOnj2rvLw8tbS06ObNm9q6dasee+wxr2SmFADAB1pbW3XkyBFNnz5dZ8+e1dtvv633339fYWFhampqumv/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QYmKifvvb36qysvK+x3z22Wfatm2bfv/738tut6usrEyS5HK55HK5NHbsWLPvoEGDNHr0aDPuhx9+qGnTpikoKEhr1qzRmjVrVFxcrNWrV+v111+XJK1bt04LFizQX//6Vz366KM++K2Be6MU0OcNGDDA/FUfFhamV199VcXFxR0eY7PZFBISIklKSkrS/v37JUllZWWaM2fOXfsnJydr3759kiSHw6Hk5GRdvXpVJ06c0IoVK5SSkqL8/HxdvHhR0q1bWna7XZKUkpLitd8VuB+eKQCSrFarJk+erMmTJ2vUqFEqKSmR1Wo1rxZvbm6+Y//+/fubryMjIzV48GCdOXNGZWVl5q/929lsNm3atElNTU367LPP9PTTT+vatWt65JFHVFpaes9MvMIc/sCVAvq8f//736qurjbfnz59Wt/97ncVHR2tU6dOSZIOHjzY4Rh2u107duzQ5cuXNXr06Lt+PmDAAI0bN07r1q3Tj370I1mtVg0cOFDDhw83t57cbrfOnDkj6dZsI4fDIUnas2ePN35NwCOUAvq8r7/+Wrm5uUpOTta8efP0xRdf6JVXXtErr7yi9evXa+HChbJarR2OkZiYqH379ikpKandfZKTk7Vnzx4lJyebbRs3blRRUZGeffZZ2e12lZeXS5Jee+01/eUvf9H8+fN15coV7/yigAd4SyoAwOBKAQBgUAoAAINSAAAYlAIAwKAUAAAGpQAAMCgFAIDxv/alBm6pR8PcAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sns.set_style('white')\n", "sns.countplot(data=dfTR, x='Survived', hue='Pclass')\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "7989a730", "metadata": { "papermill": { "duration": 0.074725, "end_time": "2022-01-23T20:23:39.393811", "exception": false, "start_time": "2022-01-23T20:23:39.319086", "status": "completed" }, "tags": [] }, "source": [ " #### Age of the passengers" ] }, { "cell_type": "code", "execution_count": 47, "id": "6c69161d", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:39.549106Z", "iopub.status.busy": "2022-01-23T20:23:39.548521Z", "iopub.status.idle": "2022-01-23T20:23:39.813736Z", "shell.execute_reply": "2022-01-23T20:23:39.813142Z", "shell.execute_reply.started": "2022-01-23T20:21:25.536880Z" }, "papermill": { "duration": 0.344837, "end_time": "2022-01-23T20:23:39.813861", "exception": false, "start_time": "2022-01-23T20:23:39.469024", "status": "completed" }, "scrolled": true, "tags": [] }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEGCAYAAACKB4k+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAWdklEQVR4nO3de3BU5eH/8U8upDJEhI1sgoGxhELLhEtnWglLUUsiSzBQVy6t1unQYJtKqylEsAKFmToQ2o5jhekfZUutMGO9gLiMBGmaDRCGezGVUrDcqg0ZyA4JCSTktpvz/YMfz1d+At8I7DkL+37NOJN9Nms+WcTPeZ5zzrMJlmVZAgBAUqLTAQAAsYNSAAAYlAIAwKAUAAAGpQAAMJKdDnAzcnJylJmZ6XQMALit1NbWau/evVd97rYuhczMTG3YsMHpGABwW5k6deo1n2P5CABgRK0UFixYII/Ho8mTJ5uxxsZGFRYWyuv1qrCwUE1NTea5VatWacKECZo4caJ27NgRrVgAgOuIWilMnTpVq1evvmLM7/fL4/GovLxcHo9Hfr9fknT8+HGVlZWprKxMq1ev1q9+9StFIpFoRQMAXEPUSuGBBx7QPffcc8VYMBiUz+eTJPl8PlVUVJjxgoICpaSkaODAgbr//vt18ODBaEUDAFyDrecU6uvr5Xa7JUlut1sNDQ2SpLq6OmVkZJjvS09PV11dnZ3RAACKkRPNV9uTLyEhwYEkABDfbC2FtLQ0hUIhSVIoFJLL5ZIkZWRk6MyZM+b76urqzIwCAGAfW0shNzdXgUBAkhQIBJSXl2fGy8rK1NHRoZqaGn3yyScaOXKkndEAAIrizWslJSXat2+fzp07p4ceekjPPfecioqKNGfOH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Oe3Zs0fHjh1TQkKCIpGIEhIS9Mgjj1z1+y3L0pAhQ8znGQCxjOUj4Av661//Kp/Pp61bt6qyslLbt2/XgAED1LdvX5WXl6urq0tnz57Vvn37JEmDBg1SQ0ODqqurJV1aTjp27JiTvwJwTcwUgC+orKxMP/7xj68Y83q9OnHihNLT0zV58mR9+ctf1siRI3X33XcrJSVFK1eu1NKlS3XhwgVFIhHNnDlTQ4YMceg3AK6Nq4+AW6ilpUW9evXSuXPnNGPGDL355pucP8BthZkCcAs988wzOn/+vDo7O/XTn/6UQsBth5kCAMDgRDMAwKAUAAAGpQAAMCgFAIBBKQAAjP8BzoZeUCm8pCAAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sns.histplot(data=dfTR, x='Age')\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "407a75af", "metadata": { "papermill": { "duration": 0.073539, "end_time": "2022-01-23T20:23:39.959397", "exception": false, "start_time": "2022-01-23T20:23:39.885858", "status": "completed" }, "tags": [] }, "source": [ "#### Siblings and Spouse count" ] }, { "cell_type": "code", "execution_count": 48, "id": "ed61255e", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:40.113976Z", "iopub.status.busy": "2022-01-23T20:23:40.113395Z", "iopub.status.idle": "2022-01-23T20:23:40.319023Z", "shell.execute_reply": "2022-01-23T20:23:40.318565Z", "shell.execute_reply.started": "2022-01-23T20:21:25.820485Z" }, "papermill": { "duration": 0.286662, "end_time": "2022-01-23T20:23:40.319154", "exception": false, "start_time": "2022-01-23T20:23:40.032492", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEGCAYAAACKB4k+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAUT0lEQVR4nO3df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pp6eHvP1hQsX9LnPfe6Gx4yPj+uVV16RJL388st6+OGHJUltbW3m8zj+8Y9/KC4uTnPnzpUktba2amRkRIODg+rs7DTXJgAncaYA3Ma1a9f0wx/+UFeuXJHb7VZ6erp27dql7373u+Yx9957r9566y2Vl5crMTFRP/nJTyRJTU1Nev7553XPPffI7XZr7969crvdkqSsrCxVVlbq8uXL+s53vmPuqw84ibukAg7Yv3+/7r33Xj355JNOTwFuwMtHAACDMwUAgMGZAgDAIAoAAIMoAAAMogAAMIgCAMD4by5GfnqIeuOmAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sns.countplot(data=dfTR, x='SibSp')\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "d7b3171c", "metadata": { "papermill": { "duration": 0.075459, "end_time": "2022-01-23T20:23:40.470328", "exception": false, "start_time": "2022-01-23T20:23:40.394869", "status": "completed" }, "tags": [] }, "source": [ "#### Distribution of Fares" ] }, { "cell_type": "code", "execution_count": 50, "id": "3311530f", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:40.620865Z", "iopub.status.busy": "2022-01-23T20:23:40.620248Z", "iopub.status.idle": "2022-01-23T20:23:43.407507Z", "shell.execute_reply": "2022-01-23T20:23:43.406878Z", "shell.execute_reply.started": "2022-01-23T20:21:26.058834Z" }, "papermill": { "duration": 2.863548, "end_time": "2022-01-23T20:23:43.407652", "exception": false, "start_time": "2022-01-23T20:23:40.544104", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEGCAYAAACKB4k+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAWkklEQVR4nO3df0xV9/3H8RdepabyLZu4y7WUkJBh2jB//FF/0FmMlwLFK4VRydplJt7ZsTEnd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text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sns.histplot(data=dfTR, x='Fare')\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "987817ef", "metadata": { "papermill": { "duration": 0.085722, "end_time": "2022-01-23T20:23:45.682201", "exception": false, "start_time": "2022-01-23T20:23:45.596479", "status": "completed" }, "tags": [] }, "source": [ "### Handle Categorical Variables" ] }, { "cell_type": "code", "execution_count": 54, "id": "5b8dad45", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:45.862820Z", "iopub.status.busy": "2022-01-23T20:23:45.861762Z", "iopub.status.idle": "2022-01-23T20:23:45.865192Z", "shell.execute_reply": "2022-01-23T20:23:45.865716Z", "shell.execute_reply.started": "2022-01-23T20:21:30.189414Z" }, "papermill": { "duration": 0.096927, "end_time": "2022-01-23T20:23:45.865878", "exception": false, "start_time": "2022-01-23T20:23:45.768951", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Sex_male
01
10
20
30
41
\n", "
" ], "text/plain": [ " Sex_male\n", "0 1\n", "1 0\n", "2 0\n", "3 0\n", "4 1" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfSex = pd.get_dummies(dfTR['Sex'], prefix='Sex', drop_first=True)\n", "dfSex.head()" ] }, { "cell_type": "code", "execution_count": 55, "id": "28ced7ff", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:45.862820Z", "iopub.status.busy": "2022-01-23T20:23:45.861762Z", "iopub.status.idle": "2022-01-23T20:23:45.865192Z", "shell.execute_reply": "2022-01-23T20:23:45.865716Z", "shell.execute_reply.started": "2022-01-23T20:21:30.189414Z" }, "papermill": { "duration": 0.096927, "end_time": "2022-01-23T20:23:45.865878", "exception": false, "start_time": "2022-01-23T20:23:45.768951", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Emb_QEmb_S
001
100
201
301
401
\n", "
" ], "text/plain": [ " Emb_Q Emb_S\n", "0 0 1\n", "1 0 0\n", "2 0 1\n", "3 0 1\n", "4 0 1" ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfEmb = pd.get_dummies(dfTR['Embarked'], prefix='Emb', drop_first=True)\n", "dfEmb.head()" ] }, { "cell_type": "code", "execution_count": 56, "id": "12e1fbb2", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:46.045359Z", "iopub.status.busy": "2022-01-23T20:23:46.044459Z", "iopub.status.idle": "2022-01-23T20:23:46.060753Z", "shell.execute_reply": "2022-01-23T20:23:46.061296Z", "shell.execute_reply.started": "2022-01-23T20:21:30.198337Z" }, "papermill": { "duration": 0.107758, "end_time": "2022-01-23T20:23:46.061478", "exception": false, "start_time": "2022-01-23T20:23:45.953720", "status": "completed" }, "scrolled": true, "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
SurvivedPclassAgeSibSpParchFareSex_maleEmb_QEmb_S
00322.0107.2500101
11138.01071.2833000
21326.0007.9250001
31135.01053.1000001
40335.0008.0500101
\n", "
" ], "text/plain": [ " Survived Pclass Age SibSp Parch Fare Sex_male Emb_Q Emb_S\n", "0 0 3 22.0 1 0 7.2500 1 0 1\n", "1 1 1 38.0 1 0 71.2833 0 0 0\n", "2 1 3 26.0 0 0 7.9250 0 0 1\n", "3 1 1 35.0 1 0 53.1000 0 0 1\n", "4 0 3 35.0 0 0 8.0500 1 0 1" ] }, "execution_count": 56, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfTR=pd.concat([dfTR.drop(['Sex','Embarked'],axis=1), dfSex, dfEmb], axis=1)\n", "dfTR.head()" ] }, { "cell_type": "markdown", "id": "98e2b4f8", "metadata": { "papermill": { "duration": 0.084343, "end_time": "2022-01-23T20:23:46.233091", "exception": false, "start_time": "2022-01-23T20:23:46.148748", "status": "completed" }, "tags": [] }, "source": [ "### ML Models for Prediction" ] }, { "cell_type": "markdown", "id": "a90fd87e", "metadata": { "papermill": { "duration": 0.083941, "end_time": "2022-01-23T20:23:46.403668", "exception": false, "start_time": "2022-01-23T20:23:46.319727", "status": "completed" }, "tags": [] }, "source": [ "### Scale the data" ] }, { "cell_type": "code", "execution_count": 60, "id": "c9909dba", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:46.881061Z", "iopub.status.busy": "2022-01-23T20:23:46.880453Z", "iopub.status.idle": "2022-01-23T20:23:46.883626Z", "shell.execute_reply": "2022-01-23T20:23:46.884119Z", "shell.execute_reply.started": "2022-01-23T20:21:30.348259Z" }, "papermill": { "duration": 0.097137, "end_time": "2022-01-23T20:23:46.884268", "exception": false, "start_time": "2022-01-23T20:23:46.787131", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "from sklearn.preprocessing import StandardScaler\n", "scalerTR = StandardScaler()" ] }, { "cell_type": "code", "execution_count": 61, "id": "be021a5e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(712, 8)" ] }, "execution_count": 61, "metadata": {}, "output_type": "execute_result" } ], "source": [ "XTR = np.array(dfTR[dfTR.columns[1:]])\n", "XTR.shape" ] }, { "cell_type": "code", "execution_count": 73, "id": "e3a4ec97", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(712,)" ] }, "execution_count": 73, "metadata": {}, "output_type": "execute_result" } ], "source": [ "YTR = np.array(dfTR[dfTR.columns[0:1]]).squeeze()\n", "YTR.shape" ] }, { "cell_type": "code", "execution_count": 74, "id": "3f9bea80", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:47.248788Z", "iopub.status.busy": "2022-01-23T20:23:47.248187Z", "iopub.status.idle": "2022-01-23T20:23:47.256031Z", "shell.execute_reply": "2022-01-23T20:23:47.256578Z", "shell.execute_reply.started": "2022-01-23T20:21:30.373973Z" }, "papermill": { "duration": 0.097559, "end_time": "2022-01-23T20:23:47.256732", "exception": false, "start_time": "2022-01-23T20:23:47.159173", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "scaler.fit(XTR)\n", "XTRNorm = scaler.transform(XTR)" ] }, { "cell_type": "markdown", "id": "ec840436", "metadata": { "papermill": { "duration": 0.089208, "end_time": "2022-01-23T20:23:47.820780", "exception": false, "start_time": "2022-01-23T20:23:47.731572", "status": "completed" }, "tags": [] }, "source": [ "### Version 1: Train - Test Split" ] }, { "cell_type": "code", "execution_count": 75, "id": "a111ced8", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:48.185081Z", "iopub.status.busy": "2022-01-23T20:23:48.184369Z", "iopub.status.idle": "2022-01-23T20:23:48.232349Z", "shell.execute_reply": "2022-01-23T20:23:48.232865Z", "shell.execute_reply.started": "2022-01-23T20:21:30.439065Z" }, "papermill": { "duration": 0.139631, "end_time": "2022-01-23T20:23:48.233090", "exception": false, "start_time": "2022-01-23T20:23:48.093459", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "from sklearn.model_selection import train_test_split\n", "X_train, X_test, Y_train, Y_test = train_test_split(XTRNorm, YTR, test_size = 0.3, random_state = 101)" ] }, { "cell_type": "markdown", "id": "71250b50", "metadata": { "papermill": { "duration": 0.087198, "end_time": "2022-01-23T20:23:48.408373", "exception": false, "start_time": "2022-01-23T20:23:48.321175", "status": "completed" }, "tags": [] }, "source": [ "### 1. Logistic Regression" ] }, { "cell_type": "code", "execution_count": 76, "id": "e6f977fe", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:48.591248Z", "iopub.status.busy": "2022-01-23T20:23:48.590591Z", "iopub.status.idle": "2022-01-23T20:23:48.799954Z", "shell.execute_reply": "2022-01-23T20:23:48.800481Z", "shell.execute_reply.started": "2022-01-23T20:21:30.506562Z" }, "papermill": { "duration": 0.301964, "end_time": "2022-01-23T20:23:48.800690", "exception": false, "start_time": "2022-01-23T20:23:48.498726", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "from sklearn.linear_model import LogisticRegression\n", "mdl = LogisticRegression()" ] }, { "cell_type": "code", "execution_count": 77, "id": "b2569c2b", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:48.979764Z", "iopub.status.busy": "2022-01-23T20:23:48.979128Z", "iopub.status.idle": "2022-01-23T20:23:48.994123Z", "shell.execute_reply": "2022-01-23T20:23:48.994672Z", "shell.execute_reply.started": "2022-01-23T20:21:30.824415Z" }, "papermill": { "duration": 0.106642, "end_time": "2022-01-23T20:23:48.994850", "exception": false, "start_time": "2022-01-23T20:23:48.888208", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "LogisticRegression()" ] }, "execution_count": 77, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mdl.fit(X_train,Y_train)" ] }, { "cell_type": "code", "execution_count": 78, "id": "85652015", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:49.176592Z", "iopub.status.busy": "2022-01-23T20:23:49.175983Z", "iopub.status.idle": "2022-01-23T20:23:49.182887Z", "shell.execute_reply": "2022-01-23T20:23:49.183388Z", "shell.execute_reply.started": "2022-01-23T20:21:30.848651Z" }, "papermill": { "duration": 0.101284, "end_time": "2022-01-23T20:23:49.183541", "exception": false, "start_time": "2022-01-23T20:23:49.082257", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "array([0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0,\n", " 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0,\n", " 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0,\n", " 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,\n", " 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1,\n", " 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,\n", " 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1,\n", " 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0,\n", " 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0,\n", " 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1])" ] }, "execution_count": 78, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pred = mdl.predict(X_test)\n", "pred" ] }, { "cell_type": "code", "execution_count": 79, "id": "781ab0cb", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:49.366810Z", "iopub.status.busy": "2022-01-23T20:23:49.366201Z", "iopub.status.idle": "2022-01-23T20:23:49.368634Z", "shell.execute_reply": "2022-01-23T20:23:49.369087Z", "shell.execute_reply.started": "2022-01-23T20:21:30.859231Z" }, "papermill": { "duration": 0.096993, "end_time": "2022-01-23T20:23:49.369233", "exception": false, "start_time": "2022-01-23T20:23:49.272240", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "array([0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,\n", " 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1,\n", " 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0,\n", " 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,\n", " 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1,\n", " 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1,\n", " 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0,\n", " 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0,\n", " 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0,\n", " 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1])" ] }, "execution_count": 79, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Y_test" ] }, { "cell_type": "code", "execution_count": 80, "id": "24fc1c96", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:49.553951Z", "iopub.status.busy": "2022-01-23T20:23:49.553319Z", "iopub.status.idle": "2022-01-23T20:23:49.556548Z", "shell.execute_reply": "2022-01-23T20:23:49.557169Z", "shell.execute_reply.started": "2022-01-23T20:21:30.875108Z" }, "papermill": { "duration": 0.098395, "end_time": "2022-01-23T20:23:49.557327", "exception": false, "start_time": "2022-01-23T20:23:49.458932", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "from sklearn.metrics import accuracy_score, classification_report, confusion_matrix" ] }, { "cell_type": "code", "execution_count": 81, "id": "adecee8b", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:49.745568Z", "iopub.status.busy": "2022-01-23T20:23:49.744903Z", "iopub.status.idle": "2022-01-23T20:23:49.750898Z", "shell.execute_reply": "2022-01-23T20:23:49.750240Z", "shell.execute_reply.started": "2022-01-23T20:21:30.885207Z" }, "papermill": { "duration": 0.100728, "end_time": "2022-01-23T20:23:49.751084", "exception": false, "start_time": "2022-01-23T20:23:49.650356", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.794392523364486\n" ] } ], "source": [ "print(accuracy_score(Y_test,pred))" ] }, { "cell_type": "code", "execution_count": 82, "id": "d5ada052", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:49.939788Z", "iopub.status.busy": "2022-01-23T20:23:49.938737Z", "iopub.status.idle": "2022-01-23T20:23:49.947162Z", "shell.execute_reply": "2022-01-23T20:23:49.947668Z", "shell.execute_reply.started": "2022-01-23T20:21:30.898560Z" }, "papermill": { "duration": 0.105416, "end_time": "2022-01-23T20:23:49.947840", "exception": false, "start_time": "2022-01-23T20:23:49.842424", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " precision recall f1-score support\n", "\n", " 0 0.82 0.84 0.83 128\n", " 1 0.76 0.72 0.74 86\n", "\n", " accuracy 0.79 214\n", " macro avg 0.79 0.78 0.78 214\n", "weighted avg 0.79 0.79 0.79 214\n", "\n" ] } ], "source": [ "print(classification_report(Y_test,pred))" ] }, { "cell_type": "code", "execution_count": 88, "id": "1893aaa9", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:50.133586Z", "iopub.status.busy": "2022-01-23T20:23:50.132993Z", "iopub.status.idle": "2022-01-23T20:23:50.345918Z", "shell.execute_reply": "2022-01-23T20:23:50.346416Z", "shell.execute_reply.started": "2022-01-23T20:21:30.915815Z" }, "papermill": { "duration": 0.307523, "end_time": "2022-01-23T20:23:50.346578", "exception": false, "start_time": "2022-01-23T20:23:50.039055", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAD4CAYAAADSIzzWAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAagElEQVR4nO3dfXRU9b3v8feEiCIPgQlOEmJEyRUvh4dwbsvFuT4cSQ5BJZwzYHVsqVW0N0dFMAGxIKJLK9hTqytpq6dMaUu06pkScaKk2jSDPBQ4PrQqbRERuBxpgAxMCEhAkpns+wdnzRGBMJlM8mO2n5drr8Xs2dn7y1r68Zfv/u3fdliWZSEiIj0uzXQBIiJfVQpgERFDFMAiIoYogEVEDFEAi4gYkt7dF2g7sLO7LyEpqM+Qa0yXIOegSGtDl8/Rmcw5b/CwLl+vKzQCFhExpNtHwCIiPao9arqCuCmARcReohHTFcRNASwitmJZ7aZLiJsCWETspV0BLCJihkbAIiKG6CaciIghGgGLiJhhaRaEiIghugknImKIWhAiIoboJpyIiCEaAYuIGKKbcCIihugmnIiIGZaVOj1grQcsIvZitce/ncWCBQtwu92UlJTE9jU3NzNjxgyKi4uZMWMGhw4din23dOlSJk6cyKRJk1i/fv1Zz68AFhF7aW+PfzuLadOmsWzZspP2+Xw+3G43dXV1uN1ufD4fANu3b6e2tpba2lqWLVvGY489RjTa8WhcASwi9pLEEfC4cePIyMg4aV8wGMTj8QDg8Xior6+P7Z88eTK9e/cmLy+PoUOHsnnz5g7Prx6wiNhLt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B4APB4P9fX1Cdfa7S2Ips8+6e5LiIjERFob4j7W7/fj9/tjn71eL16v95Tj/va3v/HRRx9RUFBAOBzG5XIBJ0K6qakp4VrVAxaRr6wzBe4XtbS0MHv2bB566CH69euX1OurBSEicgZtbW3Mnj2bKVOmUFxcDEBmZiahUAg48ep6p9OZ8PkVwCIip2FZFgsXLmTYsGHMmDEjtr+wsJBAIABAIBCgqKgo4Ws4rFSaNCci0kPee+89pk+fzvDhw0lLOzFWnTNnDmPGjKGsrIy9e/eSk5NDZWUlAwcOTOgaCmAREUPUghARMUQBLCJiiAK4h6xbt45JkyYxceLELj05I/axYMEC3G43JSUlpksRQxTAPSAajfL444+zbNkyamtrWbVqFdu3bzddlhg2bdo0li1bZroMMUgB3AM2b97M0KFDycvLo3fv3kyePJlgMGi6LDFs3LhxCS/iIvagAO4BjY2NZGdnxz5nZWXR2NhosCIRORcogHvA6Wb6ORwOA5WIyLlEAdwDsrOz2bdvX+xzY2NjbDEPEfnqUgD3gNGjR7Nr1y52795Na2srtbW1FBYWmi5LRAzTk3A9ZO3atSxZsoRoNMpNN93EPffcY7okMWzOnDm88847HDx4kMzMTGbNmsXNN99suizpQQpgERFD1IIQETFEASwiYogCWETEEAWwiIghCmAREUMUwCIihiiARUQM+f/0LeJfmAztFwAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sns.heatmap(confusion_matrix(Y_test,pred), annot=True)\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "21117947", "metadata": { "papermill": { "duration": 0.092288, "end_time": "2022-01-23T20:23:50.529624", "exception": false, "start_time": "2022-01-23T20:23:50.437336", "status": "completed" }, "tags": [] }, "source": [ "### 2. K-Nearest Neighbors" ] }, { "cell_type": "code", "execution_count": 89, "id": "79d620fb", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:50.719208Z", "iopub.status.busy": "2022-01-23T20:23:50.718603Z", "iopub.status.idle": "2022-01-23T20:23:50.775073Z", "shell.execute_reply": "2022-01-23T20:23:50.775661Z", "shell.execute_reply.started": "2022-01-23T20:21:31.148597Z" }, "papermill": { "duration": 0.153145, "end_time": "2022-01-23T20:23:50.775836", "exception": false, "start_time": "2022-01-23T20:23:50.622691", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "from sklearn.neighbors import KNeighborsClassifier" ] }, { "cell_type": "code", "execution_count": 90, "id": "30a5bb56", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:50.960111Z", "iopub.status.busy": "2022-01-23T20:23:50.959110Z", "iopub.status.idle": "2022-01-23T20:23:50.963058Z", "shell.execute_reply": "2022-01-23T20:23:50.963594Z", "shell.execute_reply.started": "2022-01-23T20:21:31.218279Z" }, "papermill": { "duration": 0.096655, "end_time": "2022-01-23T20:23:50.963757", "exception": false, "start_time": "2022-01-23T20:23:50.867102", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "knn = KNeighborsClassifier(n_neighbors=1)" ] }, { "cell_type": "code", "execution_count": 91, "id": "0af2fe7c", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:51.150310Z", "iopub.status.busy": "2022-01-23T20:23:51.149437Z", "iopub.status.idle": "2022-01-23T20:23:51.158577Z", "shell.execute_reply": "2022-01-23T20:23:51.159141Z", "shell.execute_reply.started": "2022-01-23T20:21:31.223641Z" }, "papermill": { "duration": 0.104896, "end_time": "2022-01-23T20:23:51.159297", "exception": false, "start_time": "2022-01-23T20:23:51.054401", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "KNeighborsClassifier(n_neighbors=1)" ] }, "execution_count": 91, "metadata": {}, "output_type": "execute_result" } ], "source": [ "knn.fit(X_train,Y_train)" ] }, { "cell_type": "code", "execution_count": 92, "id": "2e98570d", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:51.345612Z", "iopub.status.busy": "2022-01-23T20:23:51.344669Z", "iopub.status.idle": "2022-01-23T20:23:51.361996Z", "shell.execute_reply": "2022-01-23T20:23:51.362465Z", "shell.execute_reply.started": "2022-01-23T20:21:31.242083Z" }, "papermill": { "duration": 0.1118, "end_time": "2022-01-23T20:23:51.362617", "exception": false, "start_time": "2022-01-23T20:23:51.250817", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "array([0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1,\n", " 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1,\n", " 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0,\n", " 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1,\n", " 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0,\n", " 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1,\n", " 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0,\n", " 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0,\n", " 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0,\n", " 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1])" ] }, "execution_count": 92, "metadata": {}, "output_type": "execute_result" } ], "source": [ "knnpredict = knn.predict(X_test)\n", "knnpredict" ] }, { "cell_type": "code", "execution_count": 93, "id": "e2fb7e82", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:51.548450Z", "iopub.status.busy": "2022-01-23T20:23:51.547573Z", "iopub.status.idle": "2022-01-23T20:23:51.552795Z", "shell.execute_reply": "2022-01-23T20:23:51.552294Z", "shell.execute_reply.started": "2022-01-23T20:21:31.267829Z" }, "papermill": { "duration": 0.099323, "end_time": "2022-01-23T20:23:51.552922", "exception": false, "start_time": "2022-01-23T20:23:51.453599", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.719626168224299\n" ] } ], "source": [ "print(accuracy_score(Y_test,knnpredict))" ] }, { "cell_type": "code", "execution_count": 94, "id": "f2d96f2f", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:51.738097Z", "iopub.status.busy": "2022-01-23T20:23:51.737497Z", "iopub.status.idle": "2022-01-23T20:23:51.744956Z", "shell.execute_reply": "2022-01-23T20:23:51.745659Z", "shell.execute_reply.started": "2022-01-23T20:21:31.276068Z" }, "papermill": { "duration": 0.102282, "end_time": "2022-01-23T20:23:51.745858", "exception": false, "start_time": "2022-01-23T20:23:51.643576", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " precision recall f1-score support\n", "\n", " 0 0.78 0.74 0.76 128\n", " 1 0.64 0.69 0.66 86\n", "\n", " accuracy 0.72 214\n", " macro avg 0.71 0.71 0.71 214\n", "weighted avg 0.72 0.72 0.72 214\n", "\n" ] } ], "source": [ "print(classification_report(Y_test,knnpredict))" ] }, { "cell_type": "code", "execution_count": 95, "id": "b91997c3", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:51.932990Z", "iopub.status.busy": "2022-01-23T20:23:51.932387Z", "iopub.status.idle": "2022-01-23T20:23:52.140908Z", "shell.execute_reply": "2022-01-23T20:23:52.141488Z", "shell.execute_reply.started": "2022-01-23T20:21:31.298152Z" }, "papermill": { "duration": 0.302202, "end_time": "2022-01-23T20:23:52.141676", "exception": false, "start_time": "2022-01-23T20:23:51.839474", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAVoAAAD4CAYAAACt8i4nAAAAOXR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W7fffruuvfbaRJcFAwhaADCM1gEAGEbQAoBhBC0AGEbQAoBhBC0AGEbQAoBhBC0AGPZ/QPHU/Q2wCnIAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sns.heatmap(confusion_matrix(Y_test,knnpredict),annot=True)\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "ef31d0b7", "metadata": { "papermill": { "duration": 0.093184, "end_time": "2022-01-23T20:23:52.327493", "exception": false, "start_time": "2022-01-23T20:23:52.234309", "status": "completed" }, "tags": [] }, "source": [ "### 3 - Decision Tree" ] }, { "cell_type": "code", "execution_count": 96, "id": "6be37c5e", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:52.519580Z", "iopub.status.busy": "2022-01-23T20:23:52.518747Z", "iopub.status.idle": "2022-01-23T20:23:52.543722Z", "shell.execute_reply": "2022-01-23T20:23:52.544203Z", "shell.execute_reply.started": "2022-01-23T20:21:31.545370Z" }, "papermill": { "duration": 0.122664, "end_time": "2022-01-23T20:23:52.544371", "exception": false, "start_time": "2022-01-23T20:23:52.421707", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "from sklearn.tree import DecisionTreeClassifier" ] }, { "cell_type": "code", "execution_count": 97, "id": "7c25ef6e", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:52.735801Z", "iopub.status.busy": "2022-01-23T20:23:52.734829Z", "iopub.status.idle": "2022-01-23T20:23:52.738205Z", "shell.execute_reply": "2022-01-23T20:23:52.738658Z", "shell.execute_reply.started": "2022-01-23T20:21:31.580540Z" }, "papermill": { "duration": 0.10072, "end_time": "2022-01-23T20:23:52.738805", "exception": false, "start_time": "2022-01-23T20:23:52.638085", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "dtree = DecisionTreeClassifier()" ] }, { "cell_type": "code", "execution_count": 98, "id": "4e1c9638", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:52.937538Z", "iopub.status.busy": "2022-01-23T20:23:52.936880Z", "iopub.status.idle": "2022-01-23T20:23:52.945772Z", "shell.execute_reply": "2022-01-23T20:23:52.946293Z", "shell.execute_reply.started": "2022-01-23T20:21:31.588495Z" }, "papermill": { "duration": 0.103986, "end_time": "2022-01-23T20:23:52.946439", "exception": false, "start_time": "2022-01-23T20:23:52.842453", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "DecisionTreeClassifier()" ] }, "execution_count": 98, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dtree.fit(X_train,Y_train)" ] }, { "cell_type": "code", "execution_count": 99, "id": "ad7bf9f4", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:53.135072Z", "iopub.status.busy": "2022-01-23T20:23:53.134497Z", "iopub.status.idle": "2022-01-23T20:23:53.141100Z", "shell.execute_reply": "2022-01-23T20:23:53.141640Z", "shell.execute_reply.started": "2022-01-23T20:21:31.610798Z" }, "papermill": { "duration": 0.103273, "end_time": "2022-01-23T20:23:53.141788", "exception": false, "start_time": "2022-01-23T20:23:53.038515", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "array([0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1,\n", " 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1,\n", " 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0,\n", " 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1,\n", " 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1,\n", " 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1,\n", " 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1,\n", " 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0,\n", " 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1,\n", " 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0])" ] }, "execution_count": 99, "metadata": {}, "output_type": "execute_result" } ], "source": [ "treepredict = dtree.predict(X_test)\n", "treepredict" ] }, { "cell_type": "code", "execution_count": 100, "id": "9a676941", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:53.328857Z", "iopub.status.busy": "2022-01-23T20:23:53.328300Z", "iopub.status.idle": "2022-01-23T20:23:53.334884Z", "shell.execute_reply": "2022-01-23T20:23:53.334411Z", "shell.execute_reply.started": "2022-01-23T20:21:31.623401Z" }, "papermill": { "duration": 0.102959, "end_time": "2022-01-23T20:23:53.335038", "exception": false, "start_time": "2022-01-23T20:23:53.232079", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.7523364485981309\n" ] } ], "source": [ "print(accuracy_score(Y_test,treepredict))" ] }, { "cell_type": "code", "execution_count": 101, "id": "f51ac764", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:53.525522Z", "iopub.status.busy": "2022-01-23T20:23:53.524906Z", "iopub.status.idle": "2022-01-23T20:23:53.533434Z", "shell.execute_reply": "2022-01-23T20:23:53.534329Z", "shell.execute_reply.started": "2022-01-23T20:21:31.634094Z" }, "papermill": { "duration": 0.107556, "end_time": "2022-01-23T20:23:53.534568", "exception": false, "start_time": "2022-01-23T20:23:53.427012", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " precision recall f1-score support\n", "\n", " 0 0.80 0.79 0.79 128\n", " 1 0.69 0.70 0.69 86\n", "\n", " accuracy 0.75 214\n", " macro avg 0.74 0.74 0.74 214\n", "weighted avg 0.75 0.75 0.75 214\n", "\n" ] } ], "source": [ "print(classification_report(Y_test,treepredict))" ] }, { "cell_type": "code", "execution_count": 102, "id": "0f64d71d", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:53.735889Z", "iopub.status.busy": "2022-01-23T20:23:53.735263Z", "iopub.status.idle": "2022-01-23T20:23:53.951146Z", "shell.execute_reply": "2022-01-23T20:23:53.951926Z", "shell.execute_reply.started": "2022-01-23T20:21:31.650858Z" }, "papermill": { "duration": 0.32004, "end_time": "2022-01-23T20:23:53.952120", "exception": false, "start_time": "2022-01-23T20:23:53.632080", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAD5CAYAAAAZf+9zAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAY4UlEQVR4nO3df3RU9Z3/8eckIRBRQmZgkhAjlSwgCxjbLotTwR/JEqjE8x1RzvT3ivak61owQdiKgnxFxa/7VTfR2h6n1Bqt7XdKxAklPTZmKASBorYq3VJFQARiyeBMAgJBkpn5/uHZqSiGyTDJh7l9Pc75nOO9mdx55xzPy4/vez+fa4vFYjFERGTAZZguQETk75UCWETEEAWwiIghCmAREUMUwCIihiiARUQMyervL2gaNL6/v0LS0H9e9zPTJcg5aOOar5z1NfqSObO73+7150uWLGHDhg04HA7WrVsHQGdnJzU1NbS1tVFUVERtbS25ubkAPPnkkzQ0NJCRkcHSpUuZPn16r9fXDFhE5HPMmTOHVatWnXLO6/Xicrlobm7G5XLh9XoB2LVrF01NTTQ1NbFq1SruvfdeIpFIr9dXAIuIpdgG2RIeZzJlypT47PZ/BAIB3G43AG63m5aWlvj52bNnk52dTXFxMaNHj2b79u29Xr/fWxAiIgMpMycz4c/6fD58Pl/82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+fTujR4+muLiY7OxsZs+eTSAQMF2WGDZlyhRyc3NNlyEGKYAHQHt7OwUFBfHj/Px82tvbDVYkIucCBfAAON12GzabzUAlInIuUQAPgIKCAg4ePBg/bm9vx+l0GqxIRM4FCuABMHnyZPbu3cv+/fs5efIkTU1NlJWVmS5LRAzTdpQDZOPGjaxcuZJIJMINN9zArbfearokMWzhwoW88sordHR04HA4mD9/PnPnzjVdlgwgBbCIiCFqQYiIGKIAFhExRAEsImKIAlhExBAFsIiIIQpgERFDFMAiIob8f6eyZ+N/5H0OAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sns.heatmap(confusion_matrix(Y_test,treepredict),cmap='coolwarm',annot=True)\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "57092ee7", "metadata": { "papermill": { "duration": 0.094774, "end_time": "2022-01-23T20:23:54.150446", "exception": false, "start_time": "2022-01-23T20:23:54.055672", "status": "completed" }, "tags": [] }, "source": [ "### 4 - Random Forest" ] }, { "cell_type": "markdown", "id": "2786c8e9", "metadata": { "papermill": { "duration": 0.095706, "end_time": "2022-01-23T20:23:54.341551", "exception": false, "start_time": "2022-01-23T20:23:54.245845", "status": "completed" }, "tags": [] }, "source": [ "###
4.1 Random Forest with 10 estimators" ] }, { "cell_type": "code", "execution_count": 105, "id": "cd0eeedc", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:54.537216Z", "iopub.status.busy": "2022-01-23T20:23:54.536632Z", "iopub.status.idle": "2022-01-23T20:23:54.588430Z", "shell.execute_reply": "2022-01-23T20:23:54.589002Z", "shell.execute_reply.started": "2022-01-23T20:21:31.904586Z" }, "papermill": { "duration": 0.151368, "end_time": "2022-01-23T20:23:54.589162", "exception": false, "start_time": "2022-01-23T20:23:54.437794", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "RandomForestClassifier(n_estimators=10)" ] }, "execution_count": 105, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from sklearn.ensemble import RandomForestClassifier\n", "rfc = RandomForestClassifier(n_estimators= 10)\n", "rfc.fit(X_train,Y_train)" ] }, { "cell_type": "code", "execution_count": 106, "id": "23c488e7", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:54.788028Z", "iopub.status.busy": "2022-01-23T20:23:54.787421Z", "iopub.status.idle": "2022-01-23T20:23:54.796018Z", "shell.execute_reply": "2022-01-23T20:23:54.796549Z", "shell.execute_reply.started": "2022-01-23T20:21:31.967026Z" }, "papermill": { "duration": 0.111102, "end_time": "2022-01-23T20:23:54.796698", "exception": false, "start_time": "2022-01-23T20:23:54.685596", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "array([0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1,\n", " 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1,\n", " 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0,\n", " 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,\n", " 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1,\n", " 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1,\n", " 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0,\n", " 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0,\n", " 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0,\n", " 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1])" ] }, "execution_count": 106, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rfcpredict_10 = rfc.predict(X_test)\n", "rfcpredict_10" ] }, { "cell_type": "code", "execution_count": 107, "id": "92d7845e", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:54.988561Z", "iopub.status.busy": "2022-01-23T20:23:54.987981Z", "iopub.status.idle": "2022-01-23T20:23:54.993608Z", "shell.execute_reply": "2022-01-23T20:23:54.992872Z", "shell.execute_reply.started": "2022-01-23T20:21:31.980530Z" }, "papermill": { "duration": 0.102325, "end_time": "2022-01-23T20:23:54.993816", "exception": false, "start_time": "2022-01-23T20:23:54.891491", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.780373831775701\n" ] } ], "source": [ "print(accuracy_score(Y_test,rfcpredict_10))" ] }, { "cell_type": "code", "execution_count": 108, "id": "a90d86ce", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:55.190286Z", "iopub.status.busy": "2022-01-23T20:23:55.189311Z", "iopub.status.idle": "2022-01-23T20:23:55.197101Z", "shell.execute_reply": "2022-01-23T20:23:55.197995Z", "shell.execute_reply.started": "2022-01-23T20:21:31.990555Z" }, "papermill": { "duration": 0.108695, "end_time": "2022-01-23T20:23:55.198246", "exception": false, "start_time": "2022-01-23T20:23:55.089551", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " precision recall f1-score support\n", "\n", " 0 0.80 0.85 0.82 128\n", " 1 0.75 0.67 0.71 86\n", "\n", " accuracy 0.78 214\n", " macro avg 0.77 0.76 0.77 214\n", "weighted avg 0.78 0.78 0.78 214\n", "\n" ] } ], "source": [ "print(classification_report(Y_test,rfcpredict_10))" ] }, { "cell_type": "code", "execution_count": 109, "id": "ed2e81fa", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:55.402195Z", "iopub.status.busy": "2022-01-23T20:23:55.400026Z", "iopub.status.idle": "2022-01-23T20:23:55.615640Z", "shell.execute_reply": "2022-01-23T20:23:55.616143Z", "shell.execute_reply.started": "2022-01-23T20:21:32.011745Z" }, "papermill": { "duration": 0.319138, "end_time": "2022-01-23T20:23:55.616317", "exception": false, "start_time": "2022-01-23T20:23:55.297179", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAD4CAYAAADSIzzWAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAZSElEQVR4nO3df3BU9b3/8efZDSk/lJhd3SRNU65kQJEfaeuXS3dsuZJ8CVpi3aIYp9xWov1GWwaa4C8QkNpb8ev3Kk1ue291J7REO/ZujXTD10xrzKLCBYo6/mAc5SJyEYyS1Q2By+9kd+8f26b8MtksSz7s4fWYOePu2c05b2bWVz557+d8jhWPx+OIiMigc5guQETkQqUAFhExRAEsImKIAlhExBAFsIiIIVnn/AyWdc5PIZnnITT5Rk63PB0fi4FkjuFJYBoBi4gYcu5HwCIig8mZOeNKBbCI2Eu203QFSVMAi4i9ZGXO904KYBGxF7UgREQMcWoELCJihkbAIiKGKIBFRAzRLAgREUPUAxYRMSRLLQgRETM0AhYRMURfwomIGKIv4UREDNEIWETEEPWARUQM0QhYRMSQDBoBZ86vChGRZDgdyW/9WLx4MV6vl4qKit59XV1dVFVVUV5eTlVVFfv37+997cknn2T69OnMmDGDDRs29Ht8BbCI2Eu2M/mtH7NmzaKhoeGkfX6/H6/XS2trK16vF7/fD8COHTtoaWmhpaWFhoYGHnroIaLRaJ/HVwCLiL2kcQQ8efJkcnJyTtoXCoXw+XwA+Hw+2traevfPnDmT7OxsioqKGDVqFFu3bu3z+OoBi4i9DKAHHAgECAQCvc8rKyuprKzs82cikQgejwcAj8dDZ2cnAB0dHZSUlPS+Ly8vj46Ojj6PpQAW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+fl5dHR0WGwIhE5HyiAB8GZLja0rMy5caCInBsK4EGQn5/P3r17e593dHT0ricqIhcuBfAgmDhxIrt27WLPnj0cP36clpYWSktLTZclIoZpMZ5B8sorr7BixQqi0Sg33XQTP/zhD02XJIYtXLiQV199lX379uF2u5k/fz6zZ882XZYMIgWwiIghakGIiBiiABYRMUQBLCJiiAJYRMQQBbCIiCEKYBERQxTAIiKG/A/t0435frO3TgAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sns.heatmap(confusion_matrix(Y_test,rfcpredict_10),cmap='rainbow',annot=True)\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "b328f012", "metadata": { "papermill": { "duration": 0.099513, "end_time": "2022-01-23T20:23:55.813956", "exception": false, "start_time": "2022-01-23T20:23:55.714443", "status": "completed" }, "tags": [] }, "source": [ "###
4.2 Random Forest with 100 estimators" ] }, { "cell_type": "code", "execution_count": 110, "id": "395327e7", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:56.007678Z", "iopub.status.busy": "2022-01-23T20:23:56.007077Z", "iopub.status.idle": "2022-01-23T20:23:56.226478Z", "shell.execute_reply": "2022-01-23T20:23:56.226974Z", "shell.execute_reply.started": "2022-01-23T20:21:32.218849Z" }, "papermill": { "duration": 0.318608, "end_time": "2022-01-23T20:23:56.227146", "exception": false, "start_time": "2022-01-23T20:23:55.908538", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "RandomForestClassifier()" ] }, "execution_count": 110, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rfc_100 = RandomForestClassifier(n_estimators=100)\n", "rfc_100.fit(X_train,Y_train)" ] }, { "cell_type": "code", "execution_count": 111, "id": "59cb2425", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:56.430728Z", "iopub.status.busy": "2022-01-23T20:23:56.430089Z", "iopub.status.idle": "2022-01-23T20:23:56.449312Z", "shell.execute_reply": "2022-01-23T20:23:56.449876Z", "shell.execute_reply.started": "2022-01-23T20:21:32.450158Z" }, "papermill": { "duration": 0.122343, "end_time": "2022-01-23T20:23:56.450051", "exception": false, "start_time": "2022-01-23T20:23:56.327708", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "array([0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1,\n", " 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1,\n", " 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0,\n", " 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1,\n", " 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1,\n", " 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,\n", " 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0,\n", " 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0,\n", " 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0,\n", " 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1])" ] }, "execution_count": 111, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rfcpredict_100 = rfc_100.predict(X_test)\n", "rfcpredict_100" ] }, { "cell_type": "code", "execution_count": 112, "id": "c1378e28", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:56.652018Z", "iopub.status.busy": "2022-01-23T20:23:56.651400Z", "iopub.status.idle": "2022-01-23T20:23:56.656795Z", "shell.execute_reply": "2022-01-23T20:23:56.656156Z", "shell.execute_reply.started": "2022-01-23T20:21:32.477870Z" }, "papermill": { "duration": 0.106932, "end_time": "2022-01-23T20:23:56.656989", "exception": false, "start_time": "2022-01-23T20:23:56.550057", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.7757009345794392\n" ] } ], "source": [ "print(accuracy_score(Y_test,rfcpredict_100))" ] }, { "cell_type": "code", "execution_count": 113, "id": "c999f2aa", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:56.855745Z", "iopub.status.busy": "2022-01-23T20:23:56.855192Z", "iopub.status.idle": "2022-01-23T20:23:56.863356Z", "shell.execute_reply": "2022-01-23T20:23:56.862722Z", "shell.execute_reply.started": "2022-01-23T20:21:32.486168Z" }, "papermill": { "duration": 0.106695, "end_time": "2022-01-23T20:23:56.863501", "exception": false, "start_time": "2022-01-23T20:23:56.756806", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " precision recall f1-score support\n", "\n", " 0 0.81 0.82 0.81 128\n", " 1 0.73 0.71 0.72 86\n", "\n", " accuracy 0.78 214\n", " macro avg 0.77 0.76 0.77 214\n", "weighted avg 0.77 0.78 0.78 214\n", "\n" ] } ], "source": [ "print(classification_report(Y_test,rfcpredict_100))" ] }, { "cell_type": "code", "execution_count": 114, "id": "5d4987c5", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:57.059984Z", "iopub.status.busy": "2022-01-23T20:23:57.059393Z", "iopub.status.idle": "2022-01-23T20:23:57.274677Z", "shell.execute_reply": "2022-01-23T20:23:57.274154Z", "shell.execute_reply.started": "2022-01-23T20:21:32.506363Z" }, "papermill": { "duration": 0.313078, "end_time": "2022-01-23T20:23:57.274828", "exception": false, "start_time": "2022-01-23T20:23:56.961750", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAD4CAYAAADSI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AIuIGKIAFhExRAEsImKIAlhExBAFsIiIIQpgERFD/gueJsaR5pPL4wAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sns.heatmap(confusion_matrix(Y_test,rfcpredict_100),annot= True, cmap='magma')\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "e736ab5d", "metadata": { "papermill": { "duration": 0.098619, "end_time": "2022-01-23T20:23:57.471251", "exception": false, "start_time": "2022-01-23T20:23:57.372632", "status": "completed" }, "tags": [] }, "source": [ "### 5 - Support Vector Machines" ] }, { "cell_type": "code", "execution_count": 115, "id": "a2fb4fce", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:57.674238Z", "iopub.status.busy": "2022-01-23T20:23:57.673285Z", "iopub.status.idle": "2022-01-23T20:23:57.676535Z", "shell.execute_reply": "2022-01-23T20:23:57.677056Z", "shell.execute_reply.started": "2022-01-23T20:21:32.692524Z" }, "papermill": { "duration": 0.106545, "end_time": "2022-01-23T20:23:57.677198", "exception": false, "start_time": "2022-01-23T20:23:57.570653", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "from sklearn.svm import SVC" ] }, { "cell_type": "code", "execution_count": 116, "id": "b7c2fbc3", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:57.900818Z", "iopub.status.busy": "2022-01-23T20:23:57.900225Z", "iopub.status.idle": "2022-01-23T20:23:57.914434Z", "shell.execute_reply": "2022-01-23T20:23:57.914979Z", "shell.execute_reply.started": "2022-01-23T20:21:32.700934Z" }, "papermill": { "duration": 0.11923, "end_time": "2022-01-23T20:23:57.915145", "exception": false, "start_time": "2022-01-23T20:23:57.795915", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "SVC()" ] }, "execution_count": 116, "metadata": {}, "output_type": "execute_result" } ], "source": [ "svc = SVC()\n", "svc.fit(X_train, Y_train)" ] }, { "cell_type": "code", "execution_count": 117, "id": "bcbfe298", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:58.116542Z", "iopub.status.busy": "2022-01-23T20:23:58.115992Z", "iopub.status.idle": "2022-01-23T20:23:58.124510Z", "shell.execute_reply": "2022-01-23T20:23:58.125089Z", "shell.execute_reply.started": "2022-01-23T20:21:32.724594Z" }, "papermill": { "duration": 0.109412, "end_time": "2022-01-23T20:23:58.125257", "exception": false, "start_time": "2022-01-23T20:23:58.015845", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "array([0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0,\n", " 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1,\n", " 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0,\n", " 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,\n", " 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1,\n", " 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,\n", " 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1,\n", " 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0,\n", " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0,\n", " 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1])" ] }, "execution_count": 117, "metadata": {}, "output_type": "execute_result" } ], "source": [ "svc_predict = svc.predict(X_test)\n", "svc_predict" ] }, { "cell_type": "code", "execution_count": 118, "id": "31231092", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:58.325815Z", "iopub.status.busy": "2022-01-23T20:23:58.325247Z", "iopub.status.idle": "2022-01-23T20:23:58.330127Z", "shell.execute_reply": "2022-01-23T20:23:58.330735Z", "shell.execute_reply.started": "2022-01-23T20:21:32.739068Z" }, "papermill": { "duration": 0.107936, "end_time": "2022-01-23T20:23:58.330954", "exception": false, "start_time": "2022-01-23T20:23:58.223018", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.8037383177570093\n" ] } ], "source": [ "print(accuracy_score(Y_test,svc_predict))" ] }, { "cell_type": "code", "execution_count": 119, "id": "acb9d50c", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:58.532807Z", "iopub.status.busy": "2022-01-23T20:23:58.532219Z", "iopub.status.idle": "2022-01-23T20:23:58.540001Z", "shell.execute_reply": "2022-01-23T20:23:58.540439Z", "shell.execute_reply.started": "2022-01-23T20:21:32.749707Z" }, "papermill": { "duration": 0.110189, "end_time": "2022-01-23T20:23:58.540620", "exception": false, "start_time": "2022-01-23T20:23:58.430431", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " precision recall f1-score support\n", "\n", " 0 0.82 0.87 0.84 128\n", " 1 0.78 0.71 0.74 86\n", "\n", " accuracy 0.80 214\n", " macro avg 0.80 0.79 0.79 214\n", "weighted avg 0.80 0.80 0.80 214\n", "\n" ] } ], "source": [ "print(classification_report(Y_test,svc_predict))" ] }, { "cell_type": "code", "execution_count": 120, "id": "0d3d5288", "metadata": { "execution": { "iopub.execute_input": "2022-01-23T20:23:58.752043Z", "iopub.status.busy": "2022-01-23T20:23:58.751407Z", "iopub.status.idle": "2022-01-23T20:23:58.978682Z", "shell.execute_reply": "2022-01-23T20:23:58.979201Z", "shell.execute_reply.started": "2022-01-23T20:21:32.763397Z" }, "papermill": { "duration": 0.335174, "end_time": "2022-01-23T20:23:58.979366", "exception": false, "start_time": "2022-01-23T20:23:58.644192", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAD4CAYAAADSIzzWAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAStUlEQVR4nO3df3DTdZ7H8VdoiyDQSqqhVX4oXVg57NZx4CCHetJqAcE1C6zR81aJu1OWuwNq1TkB2VFU/HHq2PXmbgl1BXYGzVh2U6WD1gZd9EBRYeVWxAWBFRQSTH9QahFIc384l5GlrTWleQt9Pv4i32/4fN7lj+d8+RLydcTj8bgAACnXy3oAAOipCDAAGCHAAGCEAAOAEQIMAEbSu3uD2bNnd/cWOANVjx9oPQK+h/b7Hu3yGt+lOcuWLevyfl3BFTAAGCHAAGCEAAOAEQIMAEYIMAAYIcAAYIQAA4ARAgwARggwABghwABghAADgBECDABGCDAAGCHAAGCEAAOAEQIMAEYIMAAYIcAAYIQAA4ARAgwARggwABghwABghAADQDsWLFggt9utadOmJY41NDTI5/OpuLhYPp9PjY2NiXPLli3Tddddp0mTJunNN9/81vUJMAC0Y/r06aqoqDjpmN/vl9vtVk1Njdxut/x+vyRp165dqq6uVnV1tSoqKvTAAw8oFot1uD4BBoB2jB07VllZWScdC4VC8ng8kiSPx6Pa2trE8alTp6p3794aMmSIhg0bpm3btnW4fnq3TA0AZ4BAIKBAIJB47fV65fV6O/w90WhULpdLkuRyuVRXVydJCofDKigoSLxv0KBBCofDHa5FgAH0WJ0JbmfF4/FTjjkcjg5/DwEGcFa55rx13bp+dna2IpGIXC6XIpGInE6nJCknJ0cHDx5MvC8cDieulNvDPWAA+A4KCwsVDAYlScFgUEVFRYnj1dXVOnbsmPbt26e9e/fqRz/6UYdrcQUMAO0oKyvT5s2bVV9fr6uvvlpz585VSUmJSktLVVlZqdzcXJWXl0uSRowYoSlTpuj6669X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JRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sns.heatmap(confusion_matrix(Y_test,svc_predict),cmap='Dark2',annot=True)\n", "plt.show()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.13" }, "papermill": { "default_parameters": {}, "duration": 39.450285, "end_time": "2022-01-23T20:24:05.532547", "environment_variables": {}, "exception": null, "input_path": "__notebook__.ipynb", "output_path": "__notebook__.ipynb", "parameters": {}, "start_time": "2022-01-23T20:23:26.082262", "version": "2.3.3" } }, "nbformat": 4, "nbformat_minor": 5 }