Search is not available for this dataset
text
stringlengths 1.4k
102M
| id
stringlengths 22
24
| file_path
stringclasses 56
values |
---|---|---|
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "f7cb05db",
"metadata": {
"_cell_guid": "b1076dfc-b9ad-4769-8c92-a6c4dae69d19",
"_uuid": "8f2839f25d086af736a60e9eeb907d3b93b6e0e5",
"execution": {
"iopub.execute_input": "2021-12-07T18:18:17.061258Z",
"iopub.status.busy": "2021-12-07T18:18:17.059392Z",
"iopub.status.idle": "2021-12-07T18:18:18.621168Z",
"shell.execute_reply": "2021-12-07T18:18:18.621815Z",
"shell.execute_reply.started": "2021-12-07T18:13:06.341340Z"
},
"papermill": {
"duration": 1.59804,
"end_time": "2021-12-07T18:18:18.622131",
"exception": false,
"start_time": "2021-12-07T18:18:17.024091",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/kaggle/input/titanic/train.csv\n",
"/kaggle/input/titanic/test.csv\n",
"/kaggle/input/titanic/gender_submission.csv\n"
]
}
],
"source": [
"# This Python 3 environment comes with many helpful analytics libraries installed\n",
"# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n",
"# For example, here's several helpful packages to load\n",
"\n",
"import numpy as np # linear algebra\n",
"import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n",
"\n",
"# Input data files are available in the read-only \"../input/\" directory\n",
"# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n",
"\n",
"import os\n",
"for dirname, _, filenames in os.walk('/kaggle/input'):\n",
" for filename in filenames:\n",
" print(os.path.join(dirname, filename))\n",
"\n",
"# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n",
"# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"import sklearn\n",
"from sklearn.model_selection import train_test_split\n",
"from sklearn.ensemble import RandomForestClassifier\n",
"from sklearn.metrics import mean_absolute_error\n",
"from sklearn.linear_model import LogisticRegression\n",
"from sklearn.preprocessing import StandardScaler\n",
"from sklearn.neural_network import MLPClassifier\n",
"from sklearn.neighbors import KNeighborsClassifier\n",
"from sklearn.svm import SVC\n",
"from sklearn.gaussian_process import GaussianProcessClassifier\n",
"from sklearn.gaussian_process.kernels import RBF\n",
"from sklearn.tree import DecisionTreeClassifier\n",
"from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier\n",
"from sklearn.naive_bayes import GaussianNB\n",
"from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis\n",
"\n",
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "6811b801",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:18.687364Z",
"iopub.status.busy": "2021-12-07T18:18:18.686588Z",
"iopub.status.idle": "2021-12-07T18:18:18.742736Z",
"shell.execute_reply": "2021-12-07T18:18:18.743365Z",
"shell.execute_reply.started": "2021-12-07T18:13:07.822147Z"
},
"papermill": {
"duration": 0.089214,
"end_time": "2021-12-07T18:18:18.743562",
"exception": false,
"start_time": "2021-12-07T18:18:18.654348",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'pandas.core.frame.DataFrame'>\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": [
"train_data = pd.read_csv('../input/titanic/train.csv')\n",
"test_data = pd.read_csv('../input/titanic/test.csv')\n",
"train_data.info()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "7dc7e5a2",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:18.818945Z",
"iopub.status.busy": "2021-12-07T18:18:18.818166Z",
"iopub.status.idle": "2021-12-07T18:18:18.831367Z",
"shell.execute_reply": "2021-12-07T18:18:18.831973Z",
"shell.execute_reply.started": "2021-12-07T18:13:07.880407Z"
},
"papermill": {
"duration": 0.06028,
"end_time": "2021-12-07T18:18:18.832190",
"exception": false,
"start_time": "2021-12-07T18:18:18.771910",
"status": "completed"
},
"tags": []
},
"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>Total</th>\n",
" <th>Percent</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Cabin</th>\n",
" <td>687</td>\n",
" <td>3.367647</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Age</th>\n",
" <td>177</td>\n",
" <td>0.247899</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Embarked</th>\n",
" <td>2</td>\n",
" <td>0.002250</td>\n",
" </tr>\n",
" <tr>\n",
" <th>PassengerId</th>\n",
" <td>0</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Survived</th>\n",
" <td>0</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pclass</th>\n",
" <td>0</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Name</th>\n",
" <td>0</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sex</th>\n",
" <td>0</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SibSp</th>\n",
" <td>0</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Parch</th>\n",
" <td>0</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Total Percent\n",
"Cabin 687 3.367647\n",
"Age 177 0.247899\n",
"Embarked 2 0.002250\n",
"PassengerId 0 0.000000\n",
"Survived 0 0.000000\n",
"Pclass 0 0.000000\n",
"Name 0 0.000000\n",
"Sex 0 0.000000\n",
"SibSp 0 0.000000\n",
"Parch 0 0.000000"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"missing_train_total = train_data.isnull().sum().sort_values(ascending= False)\n",
"missing_train_percentage = (train_data.isnull().sum()/train_data.count()).sort_values(ascending= False)\n",
"missing_train_data = pd.concat([missing_train_total, missing_train_percentage], axis=1, keys=['Total', 'Percent'])\n",
"missing_train_data.head(10)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "2c1fa63e",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:18.896140Z",
"iopub.status.busy": "2021-12-07T18:18:18.895357Z",
"iopub.status.idle": "2021-12-07T18:18:18.912853Z",
"shell.execute_reply": "2021-12-07T18:18:18.913596Z",
"shell.execute_reply.started": "2021-12-07T18:13:07.911251Z"
},
"papermill": {
"duration": 0.05132,
"end_time": "2021-12-07T18:18:18.913785",
"exception": false,
"start_time": "2021-12-07T18:18:18.862465",
"status": "completed"
},
"tags": []
},
"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>Total</th>\n",
" <th>Percent</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Cabin</th>\n",
" <td>327</td>\n",
" <td>3.593407</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Age</th>\n",
" <td>86</td>\n",
" <td>0.259036</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Fare</th>\n",
" <td>1</td>\n",
" <td>0.002398</td>\n",
" </tr>\n",
" <tr>\n",
" <th>PassengerId</th>\n",
" <td>0</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pclass</th>\n",
" <td>0</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Name</th>\n",
" <td>0</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sex</th>\n",
" <td>0</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SibSp</th>\n",
" <td>0</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Parch</th>\n",
" <td>0</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ticket</th>\n",
" <td>0</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Total Percent\n",
"Cabin 327 3.593407\n",
"Age 86 0.259036\n",
"Fare 1 0.002398\n",
"PassengerId 0 0.000000\n",
"Pclass 0 0.000000\n",
"Name 0 0.000000\n",
"Sex 0 0.000000\n",
"SibSp 0 0.000000\n",
"Parch 0 0.000000\n",
"Ticket 0 0.000000"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"missing_test_total = test_data.isnull().sum().sort_values(ascending= False)\n",
"missing_test_percentage = (test_data.isnull().sum()/test_data.count()).sort_values(ascending= False)\n",
"missing_test_data = pd.concat([missing_test_total, missing_test_percentage], axis=1, keys=['Total', 'Percent'])\n",
"missing_test_data.head(10)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "d454ece4",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:18.980106Z",
"iopub.status.busy": "2021-12-07T18:18:18.979215Z",
"iopub.status.idle": "2021-12-07T18:18:18.992930Z",
"shell.execute_reply": "2021-12-07T18:18:18.992187Z",
"shell.execute_reply.started": "2021-12-07T18:13:07.937504Z"
},
"papermill": {
"duration": 0.04841,
"end_time": "2021-12-07T18:18:18.993075",
"exception": false,
"start_time": "2021-12-07T18:18:18.944665",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"Pclass\n",
"1 60.2875\n",
"2 14.2500\n",
"3 8.0500\n",
"Name: Fare, dtype: float64"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"train_data.groupby('Pclass')['Fare'].median()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "a976b7c5",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:19.054173Z",
"iopub.status.busy": "2021-12-07T18:18:19.053467Z",
"iopub.status.idle": "2021-12-07T18:18:19.060921Z",
"shell.execute_reply": "2021-12-07T18:18:19.061498Z",
"shell.execute_reply.started": "2021-12-07T18:13:09.654153Z"
},
"papermill": {
"duration": 0.040121,
"end_time": "2021-12-07T18:18:19.061680",
"exception": false,
"start_time": "2021-12-07T18:18:19.021559",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"Pclass\n",
"1 37.0\n",
"2 29.0\n",
"3 24.0\n",
"Name: Age, dtype: float64"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"train_data.groupby('Pclass')['Age'].median()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "563a97a7",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:19.125753Z",
"iopub.status.busy": "2021-12-07T18:18:19.124998Z",
"iopub.status.idle": "2021-12-07T18:18:19.135968Z",
"shell.execute_reply": "2021-12-07T18:18:19.136548Z",
"shell.execute_reply.started": "2021-12-07T18:13:09.668176Z"
},
"papermill": {
"duration": 0.044453,
"end_time": "2021-12-07T18:18:19.136749",
"exception": false,
"start_time": "2021-12-07T18:18:19.092296",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"Pclass\n",
"1 38.233441\n",
"2 29.877630\n",
"3 25.140620\n",
"Name: Age, dtype: float64"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"train_data.groupby('Pclass')['Age'].mean()"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "ce6a521b",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:19.206611Z",
"iopub.status.busy": "2021-12-07T18:18:19.205472Z",
"iopub.status.idle": "2021-12-07T18:18:19.218536Z",
"shell.execute_reply": "2021-12-07T18:18:19.219269Z",
"shell.execute_reply.started": "2021-12-07T18:13:09.681579Z"
},
"papermill": {
"duration": 0.050526,
"end_time": "2021-12-07T18:18:19.219446",
"exception": false,
"start_time": "2021-12-07T18:18:19.168920",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"Pclass Sex \n",
"1 female 94\n",
" male 122\n",
"2 female 76\n",
" male 108\n",
"3 female 144\n",
" male 347\n",
"Name: Sex, dtype: int64"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"train_data.groupby(['Pclass','Sex'])['Sex'].count()"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "de70f8c8",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:19.291855Z",
"iopub.status.busy": "2021-12-07T18:18:19.290757Z",
"iopub.status.idle": "2021-12-07T18:18:19.297248Z",
"shell.execute_reply": "2021-12-07T18:18:19.297904Z",
"shell.execute_reply.started": "2021-12-07T18:13:09.697763Z"
},
"papermill": {
"duration": 0.046329,
"end_time": "2021-12-07T18:18:19.298102",
"exception": false,
"start_time": "2021-12-07T18:18:19.251773",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"Sex\n",
"female 314\n",
"male 577\n",
"Name: Sex, dtype: int64"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"train_data.groupby('Sex')['Sex'].count()"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "d08d2ea7",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:19.365892Z",
"iopub.status.busy": "2021-12-07T18:18:19.364774Z",
"iopub.status.idle": "2021-12-07T18:18:20.118672Z",
"shell.execute_reply": "2021-12-07T18:18:20.119242Z",
"shell.execute_reply.started": "2021-12-07T18:13:09.709149Z"
},
"papermill": {
"duration": 0.789466,
"end_time": "2021-12-07T18:18:20.119423",
"exception": false,
"start_time": "2021-12-07T18:18:19.329957",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"<seaborn.axisgrid.FacetGrid at 0x7f075e962310>"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAFgCAYAAACVLS/VAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAZTUlEQVR4nO3dfbRldX3f8fdn7gAqGBGl0ylzYYgYLWLEOD6BTSLGiA8VtMRIWYYKCbokrQab1Ic2hpXGpTYLtSlKQVFqic+ihhgIQYQYLQoI8qTBGIZcFjIDSnxolzp3vv3j7IGbYWbuOb+5+5x7z7xfa511z95n/87+cs9hPnf/fnv/dqoKSZJGtW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AWW7TpHwWOLl7fjKD8YheJQnwfuDWqjprwrUcmGT/7vlDGYzF3MogSE4YVy1V9caqWldV6xl8Jz5fVSeNu44k+yZ5+LbnDPr8b2ICn01VfQf4hyTbblv4HOCWSdTSOZEHuq+YQB13AM9I8rDu/6Ftv4+xfkdWnEkPwiz1A3gB8LcM+trfPMb9fphB3+lPGfx1dyqDfvbLgduAvwIOGEMdz2JwuP914Pru8YIJ1fLzwNe6Wm4Cfr9b/7PAV4BvMeiy2GeMn9MvAxdPoo5ufzd0j5u3fT8n8dl0+z0SuKb7fD4NPHJC35N9gXuBRyxYN4k6zgS+0X1XPwTsM8nv6kp4OJWJJKnJtHVhSZLGxACRJDUxQCRJTQwQSVITA0SS1MQA0VRLcnySSjL2K+ClaWeAaNqdCHyx+ylpCRkgmlrdfGDPYnBR58u7dauSvKe7B8ZlST6X5ITutackubKb6PDSbVNpSNoxA0TT7DgG97v4W+DeJE8BXspg2v3DgVcwmJtr2/xhfwKcUFVPAc4H/mgSRUsrxerFN5FWrBMZTJoIg0kUT2Twnf94VW0FvpPkiu71xwFHAJcNpkJihsHUNJJ2wgDRVEpyAINZd5+YpBgEQjGYAXeHTYCbq+qZYypRWvHswtK0OgH4UFUdUlXrq2qWwR34vgv8m24sZA2DyRVhcAe8A5Pc36WV5AmTKFxaKQwQTasTefDRxieBf85gtuRbgP/N4Da7/1hVP2EQOm9PcgODWYyPGlu10grkbLza4yTZr6p+mORRDKbqProG98eQNALHQLQnuri70dXewB8aHlIbj0AkSU0cA5EkNTFAJElNDBBJUhMDRJLUxACRJDX5/yNxnB9IslY8AAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 402.375x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"sns.displot(data = train_data, x= 'Age', hue ='Pclass')"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "ccbe7448",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:20.187604Z",
"iopub.status.busy": "2021-12-07T18:18:20.186932Z",
"iopub.status.idle": "2021-12-07T18:18:20.190841Z",
"shell.execute_reply": "2021-12-07T18:18:20.191365Z",
"shell.execute_reply.started": "2021-12-07T18:13:10.257876Z"
},
"papermill": {
"duration": 0.04003,
"end_time": "2021-12-07T18:18:20.191540",
"exception": false,
"start_time": "2021-12-07T18:18:20.151510",
"status": "completed"
},
"tags": []
},
"outputs": [],
"source": [
"#sns.displot(data = train_data, x= 'Age', hue ='Pclass', multiple=\"stack\", kind=\"kde\")"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "ff870102",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:20.260476Z",
"iopub.status.busy": "2021-12-07T18:18:20.259711Z",
"iopub.status.idle": "2021-12-07T18:18:20.278293Z",
"shell.execute_reply": "2021-12-07T18:18:20.278903Z",
"shell.execute_reply.started": "2021-12-07T18:13:10.266180Z"
},
"papermill": {
"duration": 0.054949,
"end_time": "2021-12-07T18:18:20.279128",
"exception": false,
"start_time": "2021-12-07T18:18:20.224179",
"status": "completed"
},
"tags": []
},
"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></th>\n",
" <th>Age mean</th>\n",
" <th>Age median</th>\n",
" </tr>\n",
" <tr>\n",
" <th>Pclass</th>\n",
" <th>Sex</th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th rowspan=\"2\" valign=\"top\">1</th>\n",
" <th>female</th>\n",
" <td>34.611765</td>\n",
" <td>35.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>male</th>\n",
" <td>41.281386</td>\n",
" <td>40.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"2\" valign=\"top\">2</th>\n",
" <th>female</th>\n",
" <td>28.722973</td>\n",
" <td>28.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>male</th>\n",
" <td>30.740707</td>\n",
" <td>30.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"2\" valign=\"top\">3</th>\n",
" <th>female</th>\n",
" <td>21.750000</td>\n",
" <td>21.5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>male</th>\n",
" <td>26.507589</td>\n",
" <td>25.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Age mean Age median\n",
"Pclass Sex \n",
"1 female 34.611765 35.0\n",
" male 41.281386 40.0\n",
"2 female 28.722973 28.0\n",
" male 30.740707 30.0\n",
"3 female 21.750000 21.5\n",
" male 26.507589 25.0"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"mean = train_data.groupby(['Pclass','Sex'])['Age'].mean()\n",
"median = train_data.groupby(['Pclass','Sex'])['Age'].median()\n",
"age_sex_Pclass = pd.concat([mean, median], axis=1, keys=['Age mean', 'Age median'])\n",
"\n",
"age_sex_Pclass.head(6)\n"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "97bde06f",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:20.348933Z",
"iopub.status.busy": "2021-12-07T18:18:20.348130Z",
"iopub.status.idle": "2021-12-07T18:18:20.355667Z",
"shell.execute_reply": "2021-12-07T18:18:20.356244Z",
"shell.execute_reply.started": "2021-12-07T18:13:10.295076Z"
},
"papermill": {
"duration": 0.043951,
"end_time": "2021-12-07T18:18:20.356433",
"exception": false,
"start_time": "2021-12-07T18:18:20.312482",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"S 644\n",
"C 168\n",
"Q 77\n",
"Name: Embarked, dtype: int64"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"train_data.Embarked.value_counts()"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "de561783",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:20.430368Z",
"iopub.status.busy": "2021-12-07T18:18:20.429610Z",
"iopub.status.idle": "2021-12-07T18:18:20.447605Z",
"shell.execute_reply": "2021-12-07T18:18:20.448167Z",
"shell.execute_reply.started": "2021-12-07T18:13:10.304718Z"
},
"papermill": {
"duration": 0.059062,
"end_time": "2021-12-07T18:18:20.448371",
"exception": false,
"start_time": "2021-12-07T18:18:20.389309",
"status": "completed"
},
"tags": []
},
"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>Embarked</th>\n",
" <th>C</th>\n",
" <th>Q</th>\n",
" <th>S</th>\n",
" </tr>\n",
" <tr>\n",
" <th>Survived</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>75</td>\n",
" <td>47</td>\n",
" <td>427</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>93</td>\n",
" <td>30</td>\n",
" <td>217</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"Embarked C Q S\n",
"Survived \n",
"0 75 47 427\n",
"1 93 30 217"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pd.crosstab(train_data.Survived, train_data.Embarked)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "d170f7b3",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:20.537787Z",
"iopub.status.busy": "2021-12-07T18:18:20.527406Z",
"iopub.status.idle": "2021-12-07T18:18:20.550279Z",
"shell.execute_reply": "2021-12-07T18:18:20.550766Z",
"shell.execute_reply.started": "2021-12-07T18:13:10.335555Z"
},
"papermill": {
"duration": 0.062634,
"end_time": "2021-12-07T18:18:20.550967",
"exception": false,
"start_time": "2021-12-07T18:18:20.488333",
"status": "completed"
},
"tags": []
},
"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>Embarked</th>\n",
" <th>C</th>\n",
" <th>Q</th>\n",
" <th>S</th>\n",
" </tr>\n",
" <tr>\n",
" <th>Pclass</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>85</td>\n",
" <td>2</td>\n",
" <td>127</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>17</td>\n",
" <td>3</td>\n",
" <td>164</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>66</td>\n",
" <td>72</td>\n",
" <td>353</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"Embarked C Q S\n",
"Pclass \n",
"1 85 2 127\n",
"2 17 3 164\n",
"3 66 72 353"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pd.crosstab(train_data.Pclass, train_data.Embarked)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "34ae242a",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:20.622271Z",
"iopub.status.busy": "2021-12-07T18:18:20.621550Z",
"iopub.status.idle": "2021-12-07T18:18:21.107899Z",
"shell.execute_reply": "2021-12-07T18:18:21.107126Z",
"shell.execute_reply.started": "2021-12-07T18:13:10.357033Z"
},
"papermill": {
"duration": 0.523754,
"end_time": "2021-12-07T18:18:21.108055",
"exception": false,
"start_time": "2021-12-07T18:18:20.584301",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"<seaborn.axisgrid.FacetGrid at 0x7f075194c6d0>"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZoAAAFgCAYAAACCD78cAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAXrUlEQVR4nO3df7RdZX3n8feH3ICOFPDHbRpJGBhNaZkOIl4R0VYUpwvUJdgi6LhKyqKGzqjLDtNWOnQtZbUzrfOjVmtFWKJGl0IoI0OKDGj5Ucf6i6CI8sOSMkASQQJV8Cca+M4f54k5xkjuTe5zz70n79daZ529n/3svb/3rKz1ybPPPs9OVSFJUi97jboASdJ4M2gkSV0ZNJKkrgwaSVJXBo0kqauJURewO44//vi66qqrRl2GJA3LqAuYbxb0iOaBBx4YdQmSpJ1Y0EEjSZr/DBpJUlcGjSSpK4NGktSVQSNJ6sqgkSR1ZdBIkroyaCRJXRk0kqSuDBpJUlcGjSSpK4NGktSVQSNJ6mpBPyZgVxy4/CC+vnHDqMsYe09ftpxNG+4ZdRmS5oE9Lmi+vnEDp57/mVGXMfbWnHnMqEuQNE946UyS1JVBI0nqyqCRJHVl0EiSujJoJEldGTSSpK4MGklSVwaNJKkrg0aS1JVBI0nqyqCRJHVl0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MfBl4HHAx8MUkYPJzuJOAyBo8wvhW4B/jsDOqUxo6TakqSuvLSmSSpK4NGktSVQSNJ6sqgkSR1ZdBIkroyaCRJXRk0kqSu/j+4ihvlP/CPkAAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 411.875x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"sns.displot(data = train_data, x= 'Embarked', hue ='Survived', multiple=\"stack\")"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "724e984e",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:21.185729Z",
"iopub.status.busy": "2021-12-07T18:18:21.184922Z",
"iopub.status.idle": "2021-12-07T18:18:21.649229Z",
"shell.execute_reply": "2021-12-07T18:18:21.649807Z",
"shell.execute_reply.started": "2021-12-07T18:13:10.659317Z"
},
"papermill": {
"duration": 0.503838,
"end_time": "2021-12-07T18:18:21.649983",
"exception": false,
"start_time": "2021-12-07T18:18:21.146145",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"<seaborn.axisgrid.FacetGrid at 0x7f07517884d0>"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZoAAAFgCAYAAACCD78cAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAXCElEQVR4nO3dfbTdVX3n8feHhIcWFEQzWTGJE1ozuBinPBgpos6g2DYgS2ir+MAMgckYu4qOHcZWps6MOrYdnelUsVVqliBxFtUg1RKVkVIetFVBYkUogjWjYhJQLlZBZYoGvvPH2YFDvHDvTe6+596b92uts87vt3/7t8/3cG/uh9/D2SdVhSRJvewz6gIkSfObQSNJ6sqgkSR1ZdBIkroyaCRJXRk0kqSuugZNkkOSXJbk9iS3J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3zqJ2owBJ9k3yz9v2/9C2vwr4QJvBWNJu8IhGe4V22uyPGXyJ1w5gC7AOWAa8m8FXJywE3gV8BvgL4Niq+kGSPwJ+UFVvnvHCpXnAoJEkdeWpM0lSVwaNJKkrg0aS1JVBI0nqyqCRJHVl0EiSujJoJEld/X+9H+VZ/rIJDQAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 411.875x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"sns.displot(data = train_data, x= 'Sex', hue ='Survived', multiple=\"stack\")"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "0f04afb1",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:21.723022Z",
"iopub.status.busy": "2021-12-07T18:18:21.722144Z",
"iopub.status.idle": "2021-12-07T18:18:23.058368Z",
"shell.execute_reply": "2021-12-07T18:18:23.057722Z",
"shell.execute_reply.started": "2021-12-07T18:13:10.954670Z"
},
"papermill": {
"duration": 1.374104,
"end_time": "2021-12-07T18:18:23.058513",
"exception": false,
"start_time": "2021-12-07T18:18:21.684409",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"<seaborn.axisgrid.FacetGrid at 0x7f07517b0dd0>"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABGoAAAFgCAYAAADjFJ/HAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAlYUlEQVR4nO3df7Skd10n+PenuxNQEojBTCZ0uic4sLARJUoPSGBn+KEzQVxhRobAsBjdzATO4g6Msyqss/4448zIGY/KuuqQBQRZBwIISwYcEMMvFQZIIPwWQX51J4EQFJK4HpLufPaP+zS0bf+4fW/VrW/Vfb3OqXOrnqqnns+tW/dzq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enNVnbfA8gGGpLcCzJ7eCqtLUAN/3ROSvKm7/zTJl6vqIUn+SZILklyY5OlJHp4kVXVakl9L8qTufkiSlyT5d4soGmBweivA7OmtsKJ2LboAGMxTk7xguv7K6fauJK/u7ruSfKGq3jbd/4AkD0rylqpKkp1JbtracgGWgt4KMHt6K6woQQ1MqursJI9J8h1V1Vn7A9ZJXne8VZJ8tLsfvkUlAiwdvRVg9vRWWG0OfYJveFKSl3f33+nuC7p7T5LPJPnzJD80HfN7bpJHTY//RJJzqurru5RW1bcvonCAgemtALOnt8IKE9TANzw1f/N/IX43yd9OciDJx5L8P0nen+Sr3X1H1v5IPr+qPpjk+iQXb1m1AMtBbwWYPb0VVlh196JrgOFV1RndfXtV3TvJe5M8oru/sOi6AJaZ3gowe3orLD8zamB93lBVZyU5Pcm/9ccOYCb0VoDZ01thydmjBgAAAGAQZtQAAAAADEJQAwAAADAIQQ0AAADAIAQ1AAAAAIMQ1AAAAAAM4v8HOpqI2iMCD+YAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 1131.88x360 with 3 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"sns.displot(data = train_data, x= 'Age', hue ='Survived', col = 'Pclass', multiple=\"stack\")"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "d3f32059",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:23.136617Z",
"iopub.status.busy": "2021-12-07T18:18:23.135540Z",
"iopub.status.idle": "2021-12-07T18:18:24.003372Z",
"shell.execute_reply": "2021-12-07T18:18:24.003929Z",
"shell.execute_reply.started": "2021-12-07T18:13:11.992392Z"
},
"papermill": {
"duration": 0.910257,
"end_time": "2021-12-07T18:18:24.004107",
"exception": false,
"start_time": "2021-12-07T18:18:23.093850",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"<seaborn.axisgrid.FacetGrid at 0x7f0751645110>"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "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m//hrd+MJXlO923ZlUk+37UdnOSy7pu0q5IcONJ3JUlzz/FSWgC8oZialuSuqtotyWLgw8D5wOeBjzK4/fztSfbq7oL5BuCuqnpLkgdW1Xe6ZfwNcGtVvS3J1Qxuub4xyR5VdUeStwGXVNX7kuzC4BboPx7LG5ak7eR4KS087hFQ6+7X3WZ9DfAtBrcyfxLwwaq6HWCa294fkuQL3S+y5wMHd+1fBM5M8mIGt4QH+BLw2iSvAn7NX2qSdlKOl9ICs3jcBUhj9uOqWjmxIckwrzsTeGZVXZnkRcARAFX1kiSPAZ4OXJ7kUVX1/iSXdm3nJTmxqj47d29BkkbC8VJaYNwjIP2izwLPSfJAgCR7TdFnd+CWJEsYfMNF1/chVXVpVf0lsAlYkeTBwA1V9VbgY8DDe38HkjQajpfSTsw9AtIkVbU2ySnA55JsAb4KvGhSt/8LXMrgl9elDH7RAfxdd3JbgM8AVwKvAl6Q5CfAt4G/7f1NSNIIOF5KOzdPFpYkSZIa5KFBkiRJUoMMApIkSVKDDAKSJElSgwwCkiRJUoMMApIkSVKDDAKSJElSgwwCkiRJUoP+P6nqybFsk4KXAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 771.875x360 with 2 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"sns.displot(data = train_data, x= 'Pclass', hue ='Survived', col = 'Sex', multiple=\"stack\")"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "fdd48756",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:24.084416Z",
"iopub.status.busy": "2021-12-07T18:18:24.083584Z",
"iopub.status.idle": "2021-12-07T18:18:24.086772Z",
"shell.execute_reply": "2021-12-07T18:18:24.087273Z",
"shell.execute_reply.started": "2021-12-07T18:13:12.857025Z"
},
"papermill": {
"duration": 0.046369,
"end_time": "2021-12-07T18:18:24.087437",
"exception": false,
"start_time": "2021-12-07T18:18:24.041068",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"Index(['PassengerId', 'Survived', 'Pclass', 'Name', 'Sex', 'Age', 'SibSp',\n",
" 'Parch', 'Ticket', 'Fare', 'Cabin', 'Embarked'],\n",
" dtype='object')"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"train_data.columns"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "82d106f5",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:24.164402Z",
"iopub.status.busy": "2021-12-07T18:18:24.163419Z",
"iopub.status.idle": "2021-12-07T18:18:24.198885Z",
"shell.execute_reply": "2021-12-07T18:18:24.199424Z",
"shell.execute_reply.started": "2021-12-07T18:14:56.158824Z"
},
"papermill": {
"duration": 0.075639,
"end_time": "2021-12-07T18:18:24.199604",
"exception": false,
"start_time": "2021-12-07T18:18:24.123965",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'pandas.core.frame.DataFrame'>\n",
"RangeIndex: 891 entries, 0 to 890\n",
"Data columns (total 7 columns):\n",
" # Column Non-Null Count Dtype \n",
"--- ------ -------------- ----- \n",
" 0 Pclass 891 non-null int64 \n",
" 1 Sex 891 non-null int64 \n",
" 2 Age 891 non-null float64\n",
" 3 SibSp 891 non-null int64 \n",
" 4 Parch 891 non-null int64 \n",
" 5 Fare 891 non-null float64\n",
" 6 Embarked 891 non-null int64 \n",
"dtypes: float64(2), int64(5)\n",
"memory usage: 48.9 KB\n",
"0 1\n",
"1 0\n",
"2 0\n",
"3 0\n",
"4 1\n",
" ..\n",
"886 1\n",
"887 0\n",
"888 0\n",
"889 1\n",
"890 1\n",
"Name: Sex, Length: 891, dtype: int64\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/opt/conda/lib/python3.7/site-packages/pandas/core/generic.py:6392: SettingWithCopyWarning: \n",
"A value is trying to be set on a copy of a slice from a DataFrame\n",
"\n",
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
" return self._update_inplace(result)\n",
"/opt/conda/lib/python3.7/site-packages/pandas/core/generic.py:6619: SettingWithCopyWarning: \n",
"A value is trying to be set on a copy of a slice from a DataFrame\n",
"\n",
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
" return self._update_inplace(result)\n"
]
}
],
"source": [
"#Creating a list of features\n",
"features = ['Pclass', 'Sex', 'Age', 'SibSp', 'Parch', 'Fare', 'Embarked']\n",
"# X is created according to the list of features we would like to include in our model\n",
"X = train_data[features]\n",
"# y is our target variable 'Survived'\n",
"y = train_data.Survived\n",
"\n",
"#Transforming categorical variables ('Sex', 'Embarked') and filling the missing date for 'Age' and 'Fare'\n",
"\n",
"Pclass_Sex_Age_median = X.groupby(['Pclass','Sex']).Age.transform('median')\n",
"X.Age.fillna(Pclass_Sex_Age_median, inplace = True)\n",
"\n",
"Pclass_Fare_median = X.groupby('Pclass').Fare.transform('median')\n",
"X.Fare.fillna(Pclass_Fare_median, inplace = True)\n",
"\n",
"\n",
"\n",
"missing_test_total = X.isnull().sum().sort_values(ascending= False)\n",
"\n",
"\n",
"#X.groupby('Embarked')['Embarked'].count()\n",
"#Filling missing Embarked values with 'S' \n",
"#( for the greater part of passangers the port of embarkation was Southampton, U.K.)\n",
"#wikipedia confirms that whose two ladies (for whom the embarkation info is missing) embarked at Southampton\n",
"X.Embarked.fillna('S', inplace = True)\n",
"\n",
"\n",
"X['Embarked'].replace({'S': 0, 'Q': 1, 'C': 2}, inplace = True)\n",
"X['Sex'].replace({'female': 0, 'male': 1}, inplace = True)\n",
"X.info()\n",
"print(X.Sex)"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "19b070cd",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:24.282392Z",
"iopub.status.busy": "2021-12-07T18:18:24.281668Z",
"iopub.status.idle": "2021-12-07T18:18:24.288986Z",
"shell.execute_reply": "2021-12-07T18:18:24.287824Z",
"shell.execute_reply.started": "2021-12-07T18:13:12.906545Z"
},
"papermill": {
"duration": 0.052219,
"end_time": "2021-12-07T18:18:24.289237",
"exception": false,
"start_time": "2021-12-07T18:18:24.237018",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'pandas.core.frame.DataFrame'>\n"
]
}
],
"source": [
"#splitting the train data so that we have a validation set\n",
"\n",
"X_train, X_val, y_train, y_val = train_test_split(X, y, test_size = 0.25, random_state=1)\n",
"print(type(X_train))\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "f0c802f5",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:24.371250Z",
"iopub.status.busy": "2021-12-07T18:18:24.370554Z",
"iopub.status.idle": "2021-12-07T18:18:26.068420Z",
"shell.execute_reply": "2021-12-07T18:18:26.068966Z",
"shell.execute_reply.started": "2021-12-07T18:13:12.920028Z"
},
"papermill": {
"duration": 1.739165,
"end_time": "2021-12-07T18:18:26.069141",
"exception": false,
"start_time": "2021-12-07T18:18:24.329976",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[71.74887892376682, 76.23318385650224, 78.47533632286996, 78.9237668161435, 78.02690582959642, 77.57847533632287, 78.9237668161435, 78.47533632286996]\n"
]
}
],
"source": [
"clf_mae=[]\n",
"for md in range(8):\n",
" clf = RandomForestClassifier(max_depth=(md+1), random_state=1)\n",
" clf.fit(X_train, y_train)\n",
" predictions = clf.predict(X_val)\n",
" mae = (1.- mean_absolute_error(predictions, y_val))*100.\n",
" clf_mae.append(mae)\n",
" \n",
"print(clf_mae)"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "09fafb58",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:26.149277Z",
"iopub.status.busy": "2021-12-07T18:18:26.148250Z",
"iopub.status.idle": "2021-12-07T18:18:26.363223Z",
"shell.execute_reply": "2021-12-07T18:18:26.363777Z",
"shell.execute_reply.started": "2021-12-07T18:13:14.209467Z"
},
"papermill": {
"duration": 0.256714,
"end_time": "2021-12-07T18:18:26.363973",
"exception": false,
"start_time": "2021-12-07T18:18:26.107259",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"78.9237668161435\n"
]
}
],
"source": [
"clf = RandomForestClassifier(max_depth=4, random_state=1)\n",
"clf.fit(X_train, y_train)\n",
"predictions = clf.predict(X_val)\n",
"mae = (1.- mean_absolute_error(predictions, y_val))*100.\n",
"print(mae)"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "79e9be4e",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:26.450222Z",
"iopub.status.busy": "2021-12-07T18:18:26.449536Z",
"iopub.status.idle": "2021-12-07T18:18:26.459226Z",
"shell.execute_reply": "2021-12-07T18:18:26.458410Z",
"shell.execute_reply.started": "2021-12-07T18:13:14.382136Z"
},
"papermill": {
"duration": 0.055896,
"end_time": "2021-12-07T18:18:26.459418",
"exception": false,
"start_time": "2021-12-07T18:18:26.403522",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"80.26905829596413 %\n"
]
}
],
"source": [
"logreg = LogisticRegression(solver='liblinear')\n",
"logreg.fit(X_train, y_train)\n",
"predictions = logreg.predict(X_val)\n",
"mae = mean_absolute_error(predictions, y_val)\n",
"print((1-mae)*100,\"%\")\n"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "bd5da09e",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:26.548289Z",
"iopub.status.busy": "2021-12-07T18:18:26.541960Z",
"iopub.status.idle": "2021-12-07T18:18:26.550750Z",
"shell.execute_reply": "2021-12-07T18:18:26.551241Z",
"shell.execute_reply.started": "2021-12-07T18:15:08.700306Z"
},
"papermill": {
"duration": 0.051758,
"end_time": "2021-12-07T18:18:26.551420",
"exception": false,
"start_time": "2021-12-07T18:18:26.499662",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"Cabin 327\n",
"Age 86\n",
"Fare 1\n",
"PassengerId 0\n",
"Pclass 0\n",
"dtype: int64"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#test data info, missing data\n",
"missing_test_total = test_data.isnull().sum().sort_values(ascending= False)\n",
"missing_test_total.head()"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "3d3c3512",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:26.635018Z",
"iopub.status.busy": "2021-12-07T18:18:26.634326Z",
"iopub.status.idle": "2021-12-07T18:18:26.646388Z",
"shell.execute_reply": "2021-12-07T18:18:26.647216Z",
"shell.execute_reply.started": "2021-12-07T18:13:14.408147Z"
},
"papermill": {
"duration": 0.0552,
"end_time": "2021-12-07T18:18:26.647446",
"exception": false,
"start_time": "2021-12-07T18:18:26.592246",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'pandas.core.frame.DataFrame'>\n",
"RangeIndex: 418 entries, 0 to 417\n",
"Data columns (total 11 columns):\n",
" # Column Non-Null Count Dtype \n",
"--- ------ -------------- ----- \n",
" 0 PassengerId 418 non-null int64 \n",
" 1 Pclass 418 non-null int64 \n",
" 2 Name 418 non-null object \n",
" 3 Sex 418 non-null object \n",
" 4 Age 332 non-null float64\n",
" 5 SibSp 418 non-null int64 \n",
" 6 Parch 418 non-null int64 \n",
" 7 Ticket 418 non-null object \n",
" 8 Fare 417 non-null float64\n",
" 9 Cabin 91 non-null object \n",
" 10 Embarked 418 non-null object \n",
"dtypes: float64(2), int64(4), object(5)\n",
"memory usage: 36.0+ KB\n"
]
}
],
"source": [
"test_data.info()"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "2490f462",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:26.741769Z",
"iopub.status.busy": "2021-12-07T18:18:26.737499Z",
"iopub.status.idle": "2021-12-07T18:18:26.744666Z",
"shell.execute_reply": "2021-12-07T18:18:26.744003Z",
"shell.execute_reply.started": "2021-12-07T18:15:13.785353Z"
},
"papermill": {
"duration": 0.056944,
"end_time": "2021-12-07T18:18:26.744841",
"exception": false,
"start_time": "2021-12-07T18:18:26.687897",
"status": "completed"
},
"tags": []
},
"outputs": [],
"source": [
"Pclass_Sex_Age_median = test_data.groupby(['Pclass','Sex']).Age.transform('median')\n",
"test_data.Age.fillna(Pclass_Sex_Age_median, inplace = True)\n",
"\n",
"Pclass_Fare_median = test_data.groupby('Pclass').Fare.transform('median')\n",
"test_data.Fare.fillna(Pclass_Fare_median, inplace = True)\n",
"\n",
"test_data['Embarked'].replace({'S': 0, 'Q': 1, 'C': 2}, inplace = True)\n",
"test_data['Sex'].replace({'female': 0, 'male': 1}, inplace = True)\n"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "05c81a34",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:26.889405Z",
"iopub.status.busy": "2021-12-07T18:18:26.888409Z",
"iopub.status.idle": "2021-12-07T18:18:26.897851Z",
"shell.execute_reply": "2021-12-07T18:18:26.898418Z",
"shell.execute_reply.started": "2021-12-07T18:15:17.047120Z"
},
"papermill": {
"duration": 0.053499,
"end_time": "2021-12-07T18:18:26.898610",
"exception": false,
"start_time": "2021-12-07T18:18:26.845111",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"Cabin 327\n",
"PassengerId 0\n",
"Pclass 0\n",
"Name 0\n",
"Sex 0\n",
"dtype: int64"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"missing_test_total = test_data.isnull().sum().sort_values(ascending= False)\n",
"missing_test_total.head()"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "5961a629",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:18:26.983338Z",
"iopub.status.busy": "2021-12-07T18:18:26.982313Z",
"iopub.status.idle": "2021-12-07T18:18:27.109149Z",
"shell.execute_reply": "2021-12-07T18:18:27.108389Z",
"shell.execute_reply.started": "2021-12-07T18:15:20.534805Z"
},
"papermill": {
"duration": 0.170508,
"end_time": "2021-12-07T18:18:27.109433",
"exception": true,
"start_time": "2021-12-07T18:18:26.938925",
"status": "failed"
},
"tags": []
},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'X_test' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m/tmp/ipykernel_20/2907192097.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 26\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 27\u001b[0m \u001b[0mX\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mStandardScaler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfit_transform\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 28\u001b[0;31m \u001b[0mX_test\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mStandardScaler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfit_transform\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX_test\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 29\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 30\u001b[0m \u001b[0mX_train\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mX_val\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my_train\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my_val\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtrain_test_split\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtest_size\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0.25\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrandom_state\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: name 'X_test' is not defined"
]
}
],
"source": [
"names = [\n",
" \"Nearest Neighbors\",\n",
" \"Linear SVM\",\n",
" \"RBF SVM\",\n",
" \"Gaussian Process\",\n",
" \"Decision Tree\",\n",
" \"Random Forest\",\n",
" \"Neural Net\",\n",
" \"AdaBoost\",\n",
" \"Naive Bayes\",\n",
" \"QDA\",\n",
"]\n",
"\n",
"classifiers = [\n",
" KNeighborsClassifier(3),\n",
" SVC(kernel=\"linear\", C=0.025),\n",
" SVC(gamma=2, C=1),\n",
" GaussianProcessClassifier(1.0 * RBF(1.0)),\n",
" DecisionTreeClassifier(max_depth=5),\n",
" RandomForestClassifier(max_depth=5, n_estimators=100),\n",
" MLPClassifier(alpha=1, max_iter=1000),\n",
" AdaBoostClassifier(),\n",
" GaussianNB(),\n",
" QuadraticDiscriminantAnalysis(),\n",
"]\n",
"\n",
"X = StandardScaler().fit_transform(X)\n",
"X_test = StandardScaler().fit_transform(X_test)\n",
"\n",
"X_train, X_val, y_train, y_val = train_test_split(X, y, test_size = 0.25, random_state=1)\n",
"\n",
"for name, clf in zip(names, classifiers):\n",
" \n",
" clf.fit(X_train, y_train)\n",
" score = clf.score(X_val, y_val)\n",
" print(name, score)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6a7577aa",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:16:27.905816Z",
"iopub.status.busy": "2021-12-07T18:16:27.904781Z",
"iopub.status.idle": "2021-12-07T18:16:29.315883Z",
"shell.execute_reply": "2021-12-07T18:16:29.314796Z",
"shell.execute_reply.started": "2021-12-07T18:16:27.905770Z"
},
"papermill": {
"duration": null,
"end_time": null,
"exception": null,
"start_time": null,
"status": "pending"
},
"tags": []
},
"outputs": [],
"source": [
"#Using logistic regression for sumbmission\n",
"#Features list assigned above ['Pclass', 'Sex', 'Age', 'SibSp', 'Parch', 'Fare', 'Embarked']\n",
"clf = MLPClassifier(alpha=1, max_iter=1000)\n",
"\n",
"clf.fit(X, y)\n",
"predictions = clf.predict(X_test)\n",
"output = pd.DataFrame({'PassengerId': test_data.PassengerId, 'Survived': predictions})\n",
"output.to_csv('submission.csv', index=False)\n",
"print(\"Your submission was successfully saved!\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0af16413",
"metadata": {
"papermill": {
"duration": null,
"end_time": null,
"exception": null,
"start_time": null,
"status": "pending"
},
"tags": []
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.7.10"
},
"papermill": {
"default_parameters": {},
"duration": 20.729422,
"end_time": "2021-12-07T18:18:27.962274",
"environment_variables": {},
"exception": true,
"input_path": "__notebook__.ipynb",
"output_path": "__notebook__.ipynb",
"parameters": {},
"start_time": "2021-12-07T18:18:07.232852",
"version": "2.3.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
| 0081/792/81792572.ipynb | s3://data-agents/kaggle-outputs/sharded/033_00081.jsonl.gz |
{
"cells": [
{
"cell_type": "markdown",
"id": "9ea92fe7",
"metadata": {
"papermill": {
"duration": 0.023907,
"end_time": "2021-12-07T18:24:45.881420",
"exception": false,
"start_time": "2021-12-07T18:24:45.857513",
"status": "completed"
},
"tags": []
},
"source": [
"**Introduction**\n",
"\n",
"The aim of this project, is to calculate the area of a polygon, by calculating the centroid and performing iteration to calculate the overall area. \n",
"\n",
"The function created will be tested against the Shapely Library, with test data from multiple Shapefiles. "
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "aad7e7ea",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:45.939736Z",
"iopub.status.busy": "2021-12-07T18:24:45.938870Z",
"iopub.status.idle": "2021-12-07T18:24:46.301981Z",
"shell.execute_reply": "2021-12-07T18:24:46.301096Z",
"shell.execute_reply.started": "2021-12-07T18:14:54.0851Z"
},
"papermill": {
"duration": 0.398301,
"end_time": "2021-12-07T18:24:46.302152",
"exception": false,
"start_time": "2021-12-07T18:24:45.903851",
"status": "completed"
},
"tags": []
},
"outputs": [],
"source": [
"# As code is read top-down, libraries for this project are imported before any calculations or functions\n",
"import math \n",
"import shapely.geometry as shg\n",
"# Shapely Library used for analysis of geometric objects\n",
"import matplotlib.pyplot as plt \n",
"# Matplotlib Library is the plotting library, allowing for visualization of the polygons \n",
"import fiona \n",
"# Fiona Library allows for the intergration of geographic data\n",
"import numpy as np\n",
"# Numpy Library not key, but may be used to check statistical calculations\n",
"import time\n",
"# Time Library not required, but will be used later in the project\n",
"import random\n",
"# Random Library used to generate random numbers, which will be applied to the buildings shapefile data"
]
},
{
"cell_type": "markdown",
"id": "6f4ffaf4",
"metadata": {
"papermill": {
"duration": 0.021817,
"end_time": "2021-12-07T18:24:46.346696",
"exception": false,
"start_time": "2021-12-07T18:24:46.324879",
"status": "completed"
},
"tags": []
},
"source": [
"**Calculations and Code Function**\n",
"\n",
"For the area of a polygon calculation, the centroid of the polygon needs to be calculated firstly, then the area of the triangles formed between the centroid and the current and next vertices are calculated giving the area of a polygon."
]
},
{
"cell_type": "markdown",
"id": "d9fabcc9",
"metadata": {
"papermill": {
"duration": 0.021977,
"end_time": "2021-12-07T18:24:46.390912",
"exception": false,
"start_time": "2021-12-07T18:24:46.368935",
"status": "completed"
},
"tags": []
},
"source": [
"**The Centroid Calculation Code**\n",
"\n",
"The centroid, or spatial mean as it can be referred to, calculation code is below.\n",
"\n",
"Inputs for the function are the Cartesian Coordinates of the polygon (tupel) and the output is the centroid x and y value."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "d1d29484",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:46.443422Z",
"iopub.status.busy": "2021-12-07T18:24:46.442715Z",
"iopub.status.idle": "2021-12-07T18:24:46.444705Z",
"shell.execute_reply": "2021-12-07T18:24:46.445287Z",
"shell.execute_reply.started": "2021-12-07T18:14:54.092565Z"
},
"papermill": {
"duration": 0.032292,
"end_time": "2021-12-07T18:24:46.445456",
"exception": false,
"start_time": "2021-12-07T18:24:46.413164",
"status": "completed"
},
"tags": []
},
"outputs": [],
"source": [
"def centroid(coords):\n",
" adj = 1\n",
" if coords[0] != coords[-1]:\n",
" adj == 0\n",
" # The above code stops the start point of the polygon being repeated\n",
" # This is because in the polygon tupel, the start and end point are indentical to close the polygon\n",
" \n",
" x, y = zip(*coords)\n",
" # The zip function pairs the x and y values of each vertices of the polygon together \n",
" mx = 0\n",
" my = 0\n",
" # Mx and My are the average x and average y values, which is the centroid calculation output\n",
" # The Mx and My values need to be set to 0 before iteration\n",
" \n",
" for i in range(len(coords)-adj):\n",
" # I acts as a bookmark as the iteration is carried out along the length (len) of the coords tupel\n",
" mx = mx + x[i]\n",
" my = my + y[i]\n",
" mx = mx / (len(coords)-adj)\n",
" my = my / (len(coords)-adj) \n",
" return mx, my\n",
" # Output of the function is the x value and y value of the centroid of the polygon"
]
},
{
"cell_type": "markdown",
"id": "66fb8a21",
"metadata": {
"papermill": {
"duration": 0.021942,
"end_time": "2021-12-07T18:24:46.489645",
"exception": false,
"start_time": "2021-12-07T18:24:46.467703",
"status": "completed"
},
"tags": []
},
"source": [
"**Testing the Centroid Code**\n",
"\n",
"To test the code for the centroid calculation, input a tupel of coordinates with the centroid value known."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "2a76e5f1",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:46.537029Z",
"iopub.status.busy": "2021-12-07T18:24:46.536406Z",
"iopub.status.idle": "2021-12-07T18:24:46.540014Z",
"shell.execute_reply": "2021-12-07T18:24:46.540621Z",
"shell.execute_reply.started": "2021-12-07T18:14:54.105041Z"
},
"papermill": {
"duration": 0.029005,
"end_time": "2021-12-07T18:24:46.540784",
"exception": false,
"start_time": "2021-12-07T18:24:46.511779",
"status": "completed"
},
"tags": []
},
"outputs": [],
"source": [
"TestPoly = [(3,5), (5,2), (3,0), (2,2), (1,2), (3,5)] \n",
"# Expected values of 2.8 and 2.2"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "d8d40edd",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:46.588294Z",
"iopub.status.busy": "2021-12-07T18:24:46.587676Z",
"iopub.status.idle": "2021-12-07T18:24:46.592129Z",
"shell.execute_reply": "2021-12-07T18:24:46.592736Z",
"shell.execute_reply.started": "2021-12-07T18:14:54.122595Z"
},
"papermill": {
"duration": 0.030026,
"end_time": "2021-12-07T18:24:46.592895",
"exception": false,
"start_time": "2021-12-07T18:24:46.562869",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2.8 2.2\n"
]
}
],
"source": [
"x, y = (centroid(TestPoly))\n",
"print(x,y)\n",
"# Values of 2.8 and 2.2 so passes the test"
]
},
{
"cell_type": "markdown",
"id": "87e54b24",
"metadata": {
"papermill": {
"duration": 0.022423,
"end_time": "2021-12-07T18:24:46.638114",
"exception": false,
"start_time": "2021-12-07T18:24:46.615691",
"status": "completed"
},
"tags": []
},
"source": [
"**Area of Polygon Code**\n",
"\n",
"The next step of the calculation is to calculate the area of the triangles formed from the centroid to vertices, hence calculating the area of the polygon."
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "26889a43",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:46.686784Z",
"iopub.status.busy": "2021-12-07T18:24:46.686114Z",
"iopub.status.idle": "2021-12-07T18:24:46.694209Z",
"shell.execute_reply": "2021-12-07T18:24:46.694811Z",
"shell.execute_reply.started": "2021-12-07T18:14:54.13533Z"
},
"papermill": {
"duration": 0.034103,
"end_time": "2021-12-07T18:24:46.694985",
"exception": false,
"start_time": "2021-12-07T18:24:46.660882",
"status": "completed"
},
"tags": []
},
"outputs": [],
"source": [
"def polyarea(coords):\n",
" area = 0\n",
" # For summation, have to set area to zero before any calculation \n",
" xr,yr = (centroid(coords))\n",
" # Gives the centroid values from centroid code before summation calculation \n",
" # print(xr,yr)\n",
" # Print(xr,yr) not required, however put in to ensure no errors from centroid code when writing code\n",
" for i in range(len(coords)-1):\n",
" # The -1 is included above to ignore the last repeated coordinate from the tupel input data\n",
" xc = coords[i][0]\n",
" yc = coords[i][1]\n",
" xn = coords[i+1][0]\n",
" yn = coords[i+1][1]\n",
" # The code above sets current and next vertices points of the polygon for the equation\n",
" calc1 = (((xn - xr) * (yc - yr)) - ((yn - yr) * (xc - xr)))\n",
" # Main Calculation for area of a polygon above\n",
" area = area + (calc1)\n",
" # Summation Ends at this point, so the code below is unindented\n",
" \n",
" area = (abs(area))\n",
" # Above code performs absolute value to the answer from summation calculation\n",
" area = ((area) * 0.5)\n",
" # The final step is to 1/2 the absolute value \n",
" return area"
]
},
{
"cell_type": "markdown",
"id": "53db4469",
"metadata": {
"papermill": {
"duration": 0.022821,
"end_time": "2021-12-07T18:24:46.740313",
"exception": false,
"start_time": "2021-12-07T18:24:46.717492",
"status": "completed"
},
"tags": []
},
"source": [
"**Initial Testing of The Area of Polygon Code**\n",
"\n",
"As a first test of the code, a polygon in tupel format with be tested.\n",
"\n",
"The answer from the code will be checked against the shapely library."
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "3c1347a1",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:46.790278Z",
"iopub.status.busy": "2021-12-07T18:24:46.789549Z",
"iopub.status.idle": "2021-12-07T18:24:46.793249Z",
"shell.execute_reply": "2021-12-07T18:24:46.793775Z",
"shell.execute_reply.started": "2021-12-07T18:14:54.146984Z"
},
"papermill": {
"duration": 0.030566,
"end_time": "2021-12-07T18:24:46.793950",
"exception": false,
"start_time": "2021-12-07T18:24:46.763384",
"status": "completed"
},
"tags": []
},
"outputs": [],
"source": [
"TestPoly = [(3,5), (5,2), (3,0), (2,2), (1,2), (3,5)]\n",
"# Test data in the Tupel format"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "8717bcf7",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:46.843089Z",
"iopub.status.busy": "2021-12-07T18:24:46.842405Z",
"iopub.status.idle": "2021-12-07T18:24:46.848594Z",
"shell.execute_reply": "2021-12-07T18:24:46.847801Z",
"shell.execute_reply.started": "2021-12-07T18:14:54.162486Z"
},
"papermill": {
"duration": 0.031661,
"end_time": "2021-12-07T18:24:46.848784",
"exception": false,
"start_time": "2021-12-07T18:24:46.817123",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"9.0\n"
]
}
],
"source": [
"print(polyarea(TestPoly))\n",
"# Should output the area of the polygon"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "6b3986b3",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:46.901275Z",
"iopub.status.busy": "2021-12-07T18:24:46.900576Z",
"iopub.status.idle": "2021-12-07T18:24:46.902422Z",
"shell.execute_reply": "2021-12-07T18:24:46.902885Z",
"shell.execute_reply.started": "2021-12-07T18:14:54.175752Z"
},
"papermill": {
"duration": 0.030358,
"end_time": "2021-12-07T18:24:46.903073",
"exception": false,
"start_time": "2021-12-07T18:24:46.872715",
"status": "completed"
},
"tags": []
},
"outputs": [],
"source": [
"t1 = shg.Polygon(TestPoly)\n",
"# Using the Shapely library to test against the function outputs to see if the area coding is correct"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "49f64124",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:46.954500Z",
"iopub.status.busy": "2021-12-07T18:24:46.953677Z",
"iopub.status.idle": "2021-12-07T18:24:46.956813Z",
"shell.execute_reply": "2021-12-07T18:24:46.957315Z",
"shell.execute_reply.started": "2021-12-07T18:14:54.187651Z"
},
"papermill": {
"duration": 0.031177,
"end_time": "2021-12-07T18:24:46.957481",
"exception": false,
"start_time": "2021-12-07T18:24:46.926304",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"9.0\n"
]
}
],
"source": [
"print(t1.area)\n",
"# The function and Shapely library output matches for the polygon\n",
"# Hence this test is passed and the code works for this value\n",
"# However, further testing is essential"
]
},
{
"cell_type": "markdown",
"id": "36aa6d42",
"metadata": {
"papermill": {
"duration": 0.024348,
"end_time": "2021-12-07T18:24:47.005926",
"exception": false,
"start_time": "2021-12-07T18:24:46.981578",
"status": "completed"
},
"tags": []
},
"source": [
"**Plotting the Polygons for Visualization**\n",
"\n",
"For users of the code, it may be benificial to visualize a polygon, alongside the centroid and area calculations. \n",
"\n",
"To do this, the matplotlib Library must be used, and the time Library can be used.\n",
"\n",
"For testing purposes the TestPoly data will be used to ensure the polygon is correctly plotted."
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "7e81bd65",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:47.055737Z",
"iopub.status.busy": "2021-12-07T18:24:47.055063Z",
"iopub.status.idle": "2021-12-07T18:24:47.059843Z",
"shell.execute_reply": "2021-12-07T18:24:47.060427Z",
"shell.execute_reply.started": "2021-12-07T18:14:54.201511Z"
},
"papermill": {
"duration": 0.031229,
"end_time": "2021-12-07T18:24:47.060589",
"exception": false,
"start_time": "2021-12-07T18:24:47.029360",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(3, 5, 3, 2, 1, 3) (5, 2, 0, 2, 2, 5)\n"
]
}
],
"source": [
"x, y = zip(*TestPoly)\n",
"# The above code transforms the tupel list for TestPoly2 into a set of x values and a set of y values\n",
"print(x, y)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "9038d0a2",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:47.116471Z",
"iopub.status.busy": "2021-12-07T18:24:47.115472Z",
"iopub.status.idle": "2021-12-07T18:24:48.347689Z",
"shell.execute_reply": "2021-12-07T18:24:48.347090Z",
"shell.execute_reply.started": "2021-12-07T18:14:54.213705Z"
},
"papermill": {
"duration": 1.261838,
"end_time": "2021-12-07T18:24:48.347838",
"exception": false,
"start_time": "2021-12-07T18:24:47.086000",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8/fFQqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAb+klEQVR4nO3de5hddXX/8fciCSEZsLRkHqWGGH6tt4hcpxELBQkgl9BQsSgIiiKmIApUrIC/Hwhataj1VrU0ReQWQFTQcJGLEguCBhPuAYoBQpuATRANl3MSclm/P9YZc+lM5pyZvfd3730+r+eZJxPmZM5yO+cz+3z32t9l7o6IiJTXFqkLEBGRzVNQi4iUnIJaRKTkFNQiIiWnoBYRKbnReXzTCRMm+OTJk/P41iIitbRgwYJn3b13oK/lEtSTJ09m/vz5eXxrEZFaMrOnBvualj5EREpOQS0iUnIKahGRklNQi4iUnIJaRKTk2ur6MLPFwAvAWmCNu/flWZSIiKzXSXvefu7+bG6ViIjIgLT0IV3jd8CK1EWIDEO7Qe3ALWa2wMxmDvQAM5tpZvPNbP7y5cuzq1AkAz8FJgM7AnelL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IrjNWRdiY4X7r609ecy4Fpg6iYPyfT1WNagngO8r3XldE9ghbs/k7ooM3tV/7qcmU0ljl/uL+7Wc34beMTdvzzIwwo/Zu3UleKYmVmvmW3b+nwccCDw6CYPmwMc1/r8b4HbvHUVKGVdm6xjziDW/XPl7me5+0R3n0xcKLzN3Y/d5GGFH6926kpxvMysx8y26f8ceDuwaadYpq/HtmYmZs3MriS6ASaY2RLgU8SFFdz9AmI+46HAIqABfKAkdf0tcJKZrQGawFF5/7C27AW8F3iwtb4J8Elg0ga1pThm7dSV4phtD1xiZqOIXwxXu/v1ZvZpYL67zyF+wVxmZouIC8hH5VxTu3WdYmYzgDWtut5fQF0DKsHxaqeuFMfrlcC1rfOP0cAV7n6TmZ0I+bwedQu5iEjJlXXpQ0REWhTUIiIlp6AWESk5BbWISMkpqEVESk5BLSJScgpqEZGS+/9XrrbxNwd38wAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plt.fill(x, y, color='aqua')\n",
"# This code above plots the polygon and specifies the colour of the polygon\n",
"time.sleep(1) # The time library can be used to put animations on plotting, in this case it is a simple one second delay\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"id": "8bb58757",
"metadata": {
"papermill": {
"duration": 0.02464,
"end_time": "2021-12-07T18:24:48.397207",
"exception": false,
"start_time": "2021-12-07T18:24:48.372567",
"status": "completed"
},
"tags": []
},
"source": [
"**Using data in Shapefiles to Test Function**\n",
"\n",
"To further test the function, polygon data from shapefiles will be used.\n",
"\n",
"First the data from the shapefile needs to be loaded."
]
},
{
"cell_type": "markdown",
"id": "3955b282",
"metadata": {
"papermill": {
"duration": 0.024787,
"end_time": "2021-12-07T18:24:48.447371",
"exception": false,
"start_time": "2021-12-07T18:24:48.422584",
"status": "completed"
},
"tags": []
},
"source": [
"**Code to Load Shapefile Data**\n",
"\n",
"Below is the code to load shapefile data into the format for the area function created.\n",
"\n",
"Both the polygons and building shapefiles will be loaded.\n",
"\n",
"The code to print the shapefiles will be disabled as the quantity of data when displayed leads to the Kaggle notebook being hard to navigate.\n",
"\n",
"Also for the testing with data from the building shapefile, there is a section of code that selects three tupels out of the 1033 to test at random."
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "4a89e12d",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:48.500519Z",
"iopub.status.busy": "2021-12-07T18:24:48.499839Z",
"iopub.status.idle": "2021-12-07T18:24:48.549354Z",
"shell.execute_reply": "2021-12-07T18:24:48.548685Z",
"shell.execute_reply.started": "2021-12-07T18:14:55.420734Z"
},
"papermill": {
"duration": 0.077231,
"end_time": "2021-12-07T18:24:48.549504",
"exception": false,
"start_time": "2021-12-07T18:24:48.472273",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"[[(1.0, 1.0), (1.0, 50.0), (50.0, 50.0), (50.0, 1.0), (1.0, 1.0)],\n",
" [(75.0, 75.0), (120.0, 180.0), (140.0, 75.0), (75.0, 75.0)],\n",
" [(1.0, 1.0), (1.0, 5.0), (5.0, 5.0), (5.0, 1.0), (1.0, 1.0)]]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"shapefile_polygons = [] # This line of code stores the shapefile polygon data as a list \n",
"\n",
"c = fiona.open('../input/ceg1713-data-files/polygons.shp') # Using the fiona Library to open shapefile\n",
"\n",
"for each_poly in c:\n",
" geom = shg.shape(each_poly['geometry'])\n",
" poly_data = each_poly[\"geometry\"][\"coordinates\"][0]\n",
" poly = shg.Polygon(poly_data)\n",
" # print(poly)\n",
" # The code above converts shapefile data into suitable tupel format\n",
" shapefile_polygons.append(list(poly.exterior.coords))\n",
" \n",
"display(shapefile_polygons)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "dd4024cb",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:48.603524Z",
"iopub.status.busy": "2021-12-07T18:24:48.602553Z",
"iopub.status.idle": "2021-12-07T18:24:49.067517Z",
"shell.execute_reply": "2021-12-07T18:24:49.066365Z",
"shell.execute_reply.started": "2021-12-07T18:14:55.441946Z"
},
"papermill": {
"duration": 0.492906,
"end_time": "2021-12-07T18:24:49.067680",
"exception": false,
"start_time": "2021-12-07T18:24:48.574774",
"status": "completed"
},
"tags": []
},
"outputs": [],
"source": [
"shapefile_buildings = [] # This line of code stores the shapefile building data as a list \n",
"\n",
"c = fiona.open('../input/ceg1713-data-files/buildings.shp') # Using the fiona Library to open shapefile\n",
"\n",
"for each_poly in c:\n",
" geom = shg.shape(each_poly['geometry'])\n",
" poly_data = each_poly[\"geometry\"][\"coordinates\"][0]\n",
" poly = shg.Polygon(poly_data)\n",
" # print(poly)\n",
" # The code above converts shapefile data into suitable tupel format\n",
" shapefile_buildings.append(list(poly.exterior.coords))\n",
" \n",
"# display(shapefile_buildings)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "1a3f8ff1",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:49.122296Z",
"iopub.status.busy": "2021-12-07T18:24:49.121325Z",
"iopub.status.idle": "2021-12-07T18:24:49.128476Z",
"shell.execute_reply": "2021-12-07T18:24:49.129245Z",
"shell.execute_reply.started": "2021-12-07T18:14:55.619358Z"
},
"papermill": {
"duration": 0.035717,
"end_time": "2021-12-07T18:24:49.129466",
"exception": false,
"start_time": "2021-12-07T18:24:49.093749",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1033\n",
"[599, 996, 504]\n"
]
}
],
"source": [
"print(len(shapefile_buildings)) # Code to display the number of polygon tupels in the buildings shapefile (1033)\n",
"\n",
"mylist = []\n",
"for i in range(0,3):\n",
" x = random.randint(0,1033) # Uses the random library to generate random value\n",
" mylist.append(x)\n",
"print(mylist)\n",
"# The code above produces three random numbers from 0 to 1033 which correspond to a certain polygon tupel in the shapefile"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "e3ed1e45",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:49.185302Z",
"iopub.status.busy": "2021-12-07T18:24:49.183040Z",
"iopub.status.idle": "2021-12-07T18:24:49.189150Z",
"shell.execute_reply": "2021-12-07T18:24:49.188618Z",
"shell.execute_reply.started": "2021-12-07T18:14:55.628528Z"
},
"papermill": {
"duration": 0.033929,
"end_time": "2021-12-07T18:24:49.189303",
"exception": false,
"start_time": "2021-12-07T18:24:49.155374",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[(424294.4000000004, 565144.6600000001), (424291.9500000002, 565137.8000000007), (424290.9000000004, 565134.9000000004), (424282.2000000002, 565138.0999999996), (424283.3499999996, 565141.25), (424284.6299999999, 565144.7699999996), (424285.75, 565147.8399999999), (424294.4000000004, 565144.6600000001)]\n",
"[(425081.1500000004, 564700.1999999993), (425081.5499999998, 564699.1999999993), (425083.0, 564695.6500000004), (425077.25, 564693.4000000004), (425075.9000000004, 564696.8499999996), (425075.2999999998, 564698.0), (425081.1500000004, 564700.1999999993)]\n",
"[(424754.32100000046, 565224.6640000008), (424752.99700000044, 565223.25), (424751.2000000002, 565224.9499999993), (424750.6469999999, 565225.4499999993), (424751.9709999999, 565226.8640000001), (424754.32100000046, 565224.6640000008)]\n"
]
}
],
"source": [
"print(shapefile_buildings[921])\n",
"print(shapefile_buildings[264])\n",
"print(shapefile_buildings[7])\n",
"# The above code displays the corresponding polygon data to the random number generated "
]
},
{
"cell_type": "markdown",
"id": "04e60f06",
"metadata": {
"papermill": {
"duration": 0.025237,
"end_time": "2021-12-07T18:24:49.240713",
"exception": false,
"start_time": "2021-12-07T18:24:49.215476",
"status": "completed"
},
"tags": []
},
"source": [
"**Code to Test the Function with Loaded Shapefile Data**\n",
"\n",
"Now that the two shapefiles have been loaded and converted, the data can now be inputed into the area function and tested against the shapely library again."
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "43689f08",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:49.295674Z",
"iopub.status.busy": "2021-12-07T18:24:49.295001Z",
"iopub.status.idle": "2021-12-07T18:24:49.299932Z",
"shell.execute_reply": "2021-12-07T18:24:49.300391Z",
"shell.execute_reply.started": "2021-12-07T18:14:55.642404Z"
},
"papermill": {
"duration": 0.034217,
"end_time": "2021-12-07T18:24:49.300563",
"exception": false,
"start_time": "2021-12-07T18:24:49.266346",
"status": "completed"
},
"tags": []
},
"outputs": [],
"source": [
"data1 = (shapefile_polygons[0])\n",
"data2 = (shapefile_polygons[1])\n",
"data3 = (shapefile_polygons[2])\n",
"data4 = (shapefile_buildings[921])\n",
"data5 = (shapefile_buildings[264])\n",
"data6 = (shapefile_buildings[7])"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "f0b54d29",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:49.355336Z",
"iopub.status.busy": "2021-12-07T18:24:49.354729Z",
"iopub.status.idle": "2021-12-07T18:24:49.363761Z",
"shell.execute_reply": "2021-12-07T18:24:49.363143Z",
"shell.execute_reply.started": "2021-12-07T18:14:55.649806Z"
},
"papermill": {
"duration": 0.037069,
"end_time": "2021-12-07T18:24:49.363904",
"exception": false,
"start_time": "2021-12-07T18:24:49.326835",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The area is 2401.0\n",
"The area is 3412.5\n",
"The area is 16.0\n",
"The area is 95.87215000122636\n",
"The area is 30.488749994030222\n",
"The area is 6.214900001753494\n"
]
}
],
"source": [
"print('The area is {}'.format(polyarea(data1)))\n",
"print('The area is {}'.format(polyarea(data2)))\n",
"print('The area is {}'.format(polyarea(data3)))\n",
"print('The area is {}'.format(polyarea(data4)))\n",
"print('The area is {}'.format(polyarea(data5)))\n",
"print('The area is {}'.format(polyarea(data6)))\n",
"# Area of polygon outputs from the function created"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "15f361eb",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:49.418994Z",
"iopub.status.busy": "2021-12-07T18:24:49.418351Z",
"iopub.status.idle": "2021-12-07T18:24:49.424810Z",
"shell.execute_reply": "2021-12-07T18:24:49.423798Z",
"shell.execute_reply.started": "2021-12-07T18:14:55.664656Z"
},
"papermill": {
"duration": 0.03511,
"end_time": "2021-12-07T18:24:49.425060",
"exception": false,
"start_time": "2021-12-07T18:24:49.389950",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The area is 2401.0\n",
"The area is 3412.5\n",
"The area is 16.0\n"
]
}
],
"source": [
"for i in shapefile_polygons:\n",
" shg_poly = shg.Polygon(i)\n",
" print(\"The area is {}\".format(shg_poly.area))\n",
"# The shapely library values and function values match, so the code passes testing"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "25010b59",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:49.481226Z",
"iopub.status.busy": "2021-12-07T18:24:49.480596Z",
"iopub.status.idle": "2021-12-07T18:24:49.486524Z",
"shell.execute_reply": "2021-12-07T18:24:49.487092Z",
"shell.execute_reply.started": "2021-12-07T18:14:55.679292Z"
},
"papermill": {
"duration": 0.035236,
"end_time": "2021-12-07T18:24:49.487289",
"exception": false,
"start_time": "2021-12-07T18:24:49.452053",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The area is 95.87215000122634\n",
"The area is 30.488749994030222\n",
"The area is 6.214900001753493\n"
]
}
],
"source": [
"t4 = shg.Polygon(data4)\n",
"t5 = shg.Polygon(data5)\n",
"t6 = shg.Polygon(data6)\n",
"print('The area is {}'.format(t4.area))\n",
"print('The area is {}'.format(t5.area))\n",
"print('The area is {}'.format(t6.area))\n",
"# The shapely library values and function values match, so the code passes testing"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "9d022ac8",
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-07T18:24:49.544379Z",
"iopub.status.busy": "2021-12-07T18:24:49.543703Z",
"iopub.status.idle": "2021-12-07T18:24:49.734296Z",
"shell.execute_reply": "2021-12-07T18:24:49.733463Z",
"shell.execute_reply.started": "2021-12-07T18:14:55.689113Z"
},
"papermill": {
"duration": 0.220383,
"end_time": "2021-12-07T18:24:49.734443",
"exception": false,
"start_time": "2021-12-07T18:24:49.514060",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAANEAAAD4CAYAAABymQMRAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8/fFQqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAQwklEQVR4nO3da6xc5XnF8f/C9rGLuRobCwGOIXKQSNOY1KKRGqKkuRRQVUM/UGgVHIFkUIPUKJEq0nwoUpWqakuRorSkRkEYKRBQKIIPtMV1K6JKoc0xcc3N4EtssGMfX4htyt320w+zB29vz9hz5t179p6Z9ZOOzsw7M2fekb08M4/3WaOIwMz6d1rdGzAbdg6RWSKHyCyRQ2SWyCEySzSz7g0AzJ8/PxYvXlz3Nsy6Wrdu3b6IWNDpskaEaPHixUxOTta9DbOuJG3vdplfzpklcojMEjlEZokcIrNEDpFZIofILJFDZJbIITJL5BDZ8DiwB555FI4erXsnx3GIbHhs3QBT2+GdN+veyXEcIhsO774Fr2+EmRPw5q/q3s1xThkiSfdL2iPphdzaI5LWZ1/bJK3P1hdLeid32fcr3LuNk9c2QgScdhoc3Ff3bo7TywGoDwDfAx5sL0TEH7ZPS7obOJi7/paIWFrS/szgyGHY/BycfhZ88D688cu6d3ScUz4TRcRPgDc6XSZJwA3AwyXvy+yYqW3w7jswazZMzIE3dreelRoi9T3RVcBURGzKrV0i6eeSnpF0VbcbSlopaVLS5N69exO3YSMrAl5dB3N+rXV+5iz44D147+1695WTGqKbOP5ZaBewKCKuAL4BPCTprE43jIhVEbEsIpYtWNDxd53M4OBe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HJZ0B/BvwAzg/oh4sYr7MqtbZUcsRMRTuJfbxoCPWDBL5BCZJXKIzBIpIureA5L2Atu7XDwf2NflsmHnxzY8PhIRHf9DsxEhOhlJkxGxrO59VMGPbTT45ZxZIofILNEwhGhV3RuokB/bCGj8eyKzphuGZyKzRnOIzBI1NkSj2NEgaZuk5yWtlzSZrc2TtEbSpuz7uXXvsxeS7pe0R9ILubWOj0Ut383+LDdI+lR9Oy9fI0M04h0Nn4+Ipbn/Q7kTWBsRS4C12flh8ABwdWGt22O5BliSfa0E7h3QHgeikSEi19EQEe8D7Y6GUbQcWJ2dXg1cV99WehcRPwHeKCx3eyzLgQej5VngHEkXDGSjA9DUEHXqaLiwpr2UKYCnJa3LOiYAFkbEruz0bmBhPVsrRbfHMqp/nsCwNKCOjs9ExE5J5wNrJG3MXxgRIWkk/s9hlB7LqTT1mWgkOxoiYmf2fQ/wOK2XrVPtlzbZ92HuAuv2WEbyz7OtqSEauY4GSXMlndk+DXwZeIHW41qRXW0F8EQ9OyxFt8fyJHBzNqX7NHAw97Jv+EVEI7+Aa4FXgS3At+veTwmP51Lgf7OvF9uPCTiP1iRrE/DvwLy699rj43kY2AV8QOs9zq3dHgsgWtPWLcDzwLK691/mlw/7MUvU1JdzZkPDITJL5BCZJXKIzBI5RGaJHCKzRA6RWaL/B/WBcrWRvjAGAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plt.gca().set_aspect('equal', adjustable='box') \n",
"#The Code above is to make the x and y axis the same scale when plotting\n",
"\n",
"for poly in shapefile_polygons:\n",
" xy = list(zip(*poly))\n",
" plt.fill(xy[0], xy[1], alpha=0.5, color = 'coral')"
]
},
{
"cell_type": "markdown",
"id": "78b1893b",
"metadata": {
"papermill": {
"duration": 0.026711,
"end_time": "2021-12-07T18:24:49.788343",
"exception": false,
"start_time": "2021-12-07T18:24:49.761632",
"status": "completed"
},
"tags": []
},
"source": [
"**Conclusion**\n",
"\n",
"In summary, the function created to calculate the area of a polygon is functioning as it should having been tested against the Shapely Library for Seven different tupels. "
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.7.12"
},
"papermill": {
"default_parameters": {},
"duration": 14.810441,
"end_time": "2021-12-07T18:24:50.425952",
"environment_variables": {},
"exception": null,
"input_path": "__notebook__.ipynb",
"output_path": "__notebook__.ipynb",
"parameters": {},
"start_time": "2021-12-07T18:24:35.615511",
"version": "2.3.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
| 0081/792/81792932.ipynb | s3://data-agents/kaggle-outputs/sharded/033_00081.jsonl.gz |
"{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"e0823ebd\",\n \"metadata\": (...TRUNCATED) | 0081/793/81793766.ipynb | s3://data-agents/kaggle-outputs/sharded/033_00081.jsonl.gz |
"{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"f64311d6\",\n \"metadata\": (...TRUNCATED) | 0081/793/81793978.ipynb | s3://data-agents/kaggle-outputs/sharded/033_00081.jsonl.gz |
"{\"metadata\":{\"kernelspec\":{\"language\":\"python\",\"display_name\":\"Python 3\",\"name\":\"pyt(...TRUNCATED) | 0081/794/81794264.ipynb | s3://data-agents/kaggle-outputs/sharded/033_00081.jsonl.gz |
"{\n \"cells\": [\n {\n \"attachments\": {\n \"2b356f54-cb7f-4259-9290-3dd331b9d154.png\": {\n(...TRUNCATED) | 0081/794/81794582.ipynb | s3://data-agents/kaggle-outputs/sharded/033_00081.jsonl.gz |
"{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"ec1eb105\",\n \"metadata\": (...TRUNCATED) | 0081/795/81795695.ipynb | s3://data-agents/kaggle-outputs/sharded/033_00081.jsonl.gz |
"{\"metadata\":{\"kernelspec\":{\"language\":\"python\",\"display_name\":\"Python 3\",\"name\":\"pyt(...TRUNCATED) | 0081/795/81795719.ipynb | s3://data-agents/kaggle-outputs/sharded/033_00081.jsonl.gz |
"{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"922cf2a0\",\n \"metadata\": (...TRUNCATED) | 0081/795/81795796.ipynb | s3://data-agents/kaggle-outputs/sharded/033_00081.jsonl.gz |
"{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"f53847f5\",\n \"metadata\": (...TRUNCATED) | 0081/795/81795919.ipynb | s3://data-agents/kaggle-outputs/sharded/033_00081.jsonl.gz |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
- Downloads last month
- 10