{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"<h2> -Titanic - Machine Learning from Disaster Competition ","metadata":{}},{"cell_type":"markdown","source":"I have two similar datasets that include passenger information such as name, age, gender, socioeconomic class, etc. One data set is titled \"train.csv\" and the other is titled \"test.csv\".Train.csv will contain details of a subset of the passengers on board (891 to be exact) and most importantly, it will reveal whether or not they survived, also known as the \"ground truth\".The dataset \"test.csv\" contains similar information but does not reveal the \"ground truth\" for every passenger.","metadata":{}},{"cell_type":"markdown","source":"Done by **Islam Aljuneidi**","metadata":{}},{"cell_type":"markdown","source":"<h2>Table of contents","metadata":{}},{"cell_type":"markdown","source":"<ul>\n    \n<li><b>Introduction\n    \n<li><b>Research Question\n    \n<li><b>Data Wrangling\n    \n<li><b>Exploratory_Data Analysis\n    \n<li><b>Machine Learning\n    \n<li><b>Conclusion","metadata":{}},{"cell_type":"markdown","source":"<h3 id=\"intro\">Introduction","metadata":{}},{"cell_type":"markdown","source":"In this section, we will briefly explain our dataset \"Train Dataset\", what it contains, and also what is each column?so our dataset contains 891 k rows and 12 columns so we explain once over what does it contains each column?\n\n<ol>\n<li>PassengerId. Unique identification of the passenger.\n<li>survived. Survival (0 = no, 1 = yes).\n<li>Pclass. Ticket category (1 = first, 2 = second, 3 = third).\n<li>Name. Passenger's name. We need analysis before using it.\n<li>sex. sex. The categorical variable\n<li>age. Age in years.\n<li>SibSp. The number of siblings/couples aboard the Titanic.\n<li>Parch. # Parents/children aboard the Titanic.\n<li>a ticket. ticket number. A big mess.\n<li>Rent. Passenger fare.\n<li>The Plane. cabin number. It must be analyzed.\n<li>embarked. Departure port (C = Cherbourg, Q = Queenstown, S = Southampton).","metadata":{}},{"cell_type":"markdown","source":"<h3 id=\"Ques\">Research Questions","metadata":{}},{"cell_type":"markdown","source":"-In this section we will ask ourselves what we need from this dataset I think that section is the most important step in data analysis steps because if you ask the right question you will get specific information and according to that  will help you to  make right decisions and efficient.","metadata":{}},{"cell_type":"markdown","source":"<ul>\n<li>How many people have survived?\n<li>Which class has the majority?\n<li>Are there more men than women or vice versa?\n<li>Which ages were dominant in this trip?\n<li>are there many relatives in this trip?\n<li>Which Embarked has the majority?","metadata":{}},{"cell_type":"markdown","source":"<h3>Import libraries","metadata":{}},{"cell_type":"markdown","source":"Now, Let's import some of the various commands and have access to our dataset.","metadata":{}},{"cell_type":"code","source":"import numpy as np \nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport statsmodels.api as sm\nimport seaborn as sns\nimport random\nimport time\n%matplotlib inline\nfrom numpy.polynomial.polynomial import polyfit\nfrom bs4 import BeautifulSoup as soup\nfrom urllib.request import urlopen\nfrom sklearn.linear_model import LinearRegression,LogisticRegression\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import accuracy_score,confusion_matrix,precision_score,classification_report\nrandom.seed(40)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:18.920702Z","iopub.execute_input":"2022-07-19T21:27:18.921644Z","iopub.status.idle":"2022-07-19T21:27:18.931687Z","shell.execute_reply.started":"2022-07-19T21:27:18.921601Z","shell.execute_reply":"2022-07-19T21:27:18.930498Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h3>Data Wrangling","metadata":{}},{"cell_type":"markdown","source":"let's divide data wrangling to three main factors **Gathering Data,assess and cleaning Data**","metadata":{}},{"cell_type":"markdown","source":"<h4>Gathering Data","metadata":{}},{"cell_type":"code","source":"#import our dataset -the file is csv so we will use read_csv to read our file\ndf=pd.read_csv(\"/kaggle/input/titanic/train.csv\")\ndf.head(2)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:18.945547Z","iopub.execute_input":"2022-07-19T21:27:18.945948Z","iopub.status.idle":"2022-07-19T21:27:18.989519Z","shell.execute_reply.started":"2022-07-19T21:27:18.945913Z","shell.execute_reply":"2022-07-19T21:27:18.988504Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h4>Assessing Data\n","metadata":{}},{"cell_type":"markdown","source":"at this section we dig into the data if they duplicated rows,missing value or rename columns","metadata":{}},{"cell_type":"code","source":"#size Dataseet what does it contains\ndf.shape","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:18.991643Z","iopub.execute_input":"2022-07-19T21:27:18.992353Z","iopub.status.idle":"2022-07-19T21:27:18.998610Z","shell.execute_reply.started":"2022-07-19T21:27:18.992318Z","shell.execute_reply":"2022-07-19T21:27:18.997408Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#names of our columns\nfor x in list(df.columns[0:]):\n    print(x)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:18.999737Z","iopub.execute_input":"2022-07-19T21:27:19.000996Z","iopub.status.idle":"2022-07-19T21:27:19.010391Z","shell.execute_reply.started":"2022-07-19T21:27:19.000950Z","shell.execute_reply":"2022-07-19T21:27:19.009015Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#check if there any missing values\ndf.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.014018Z","iopub.execute_input":"2022-07-19T21:27:19.014488Z","iopub.status.idle":"2022-07-19T21:27:19.025770Z","shell.execute_reply.started":"2022-07-19T21:27:19.014432Z","shell.execute_reply":"2022-07-19T21:27:19.024368Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<ul><li>there's missing values we will deal with them later","metadata":{}},{"cell_type":"code","source":"#check if there any duplicated values\ndf.duplicated().sum()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.029277Z","iopub.execute_input":"2022-07-19T21:27:19.029595Z","iopub.status.idle":"2022-07-19T21:27:19.048938Z","shell.execute_reply.started":"2022-07-19T21:27:19.029567Z","shell.execute_reply":"2022-07-19T21:27:19.047741Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<ul><li>there isn't any duplicated values at our dataset","metadata":{}},{"cell_type":"code","source":"#Let's take a quick overview of our data\ndf.info()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.050533Z","iopub.execute_input":"2022-07-19T21:27:19.051490Z","iopub.status.idle":"2022-07-19T21:27:19.072689Z","shell.execute_reply.started":"2022-07-19T21:27:19.051436Z","shell.execute_reply":"2022-07-19T21:27:19.071507Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#describe our  Gategorical Data\ndf.describe(include=[object])","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.074550Z","iopub.execute_input":"2022-07-19T21:27:19.075271Z","iopub.status.idle":"2022-07-19T21:27:19.098183Z","shell.execute_reply.started":"2022-07-19T21:27:19.075204Z","shell.execute_reply":"2022-07-19T21:27:19.097257Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#describe our  numerical Data\ndf.describe()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.099315Z","iopub.execute_input":"2022-07-19T21:27:19.099688Z","iopub.status.idle":"2022-07-19T21:27:19.133661Z","shell.execute_reply.started":"2022-07-19T21:27:19.099658Z","shell.execute_reply":"2022-07-19T21:27:19.132562Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# number of non-null unique values for each feature\nfor i in df.columns:\n    print(i,len(df[i].unique()))","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.135106Z","iopub.execute_input":"2022-07-19T21:27:19.136119Z","iopub.status.idle":"2022-07-19T21:27:19.142707Z","shell.execute_reply.started":"2022-07-19T21:27:19.136087Z","shell.execute_reply":"2022-07-19T21:27:19.141888Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h4>Data Cleaning\n","metadata":{}},{"cell_type":"code","source":"df.head(3)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.145961Z","iopub.execute_input":"2022-07-19T21:27:19.146465Z","iopub.status.idle":"2022-07-19T21:27:19.163228Z","shell.execute_reply.started":"2022-07-19T21:27:19.146433Z","shell.execute_reply":"2022-07-19T21:27:19.162144Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# split the name columns to title of names like MR,MRS\ndf[\"Title\"]=df[\"Name\"].str.split(expand=True)[1]","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.164579Z","iopub.execute_input":"2022-07-19T21:27:19.165052Z","iopub.status.idle":"2022-07-19T21:27:19.177775Z","shell.execute_reply.started":"2022-07-19T21:27:19.165006Z","shell.execute_reply":"2022-07-19T21:27:19.176614Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#drop the name column it's not useful anymore\ndf.drop(columns=\"Name\",inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.179302Z","iopub.execute_input":"2022-07-19T21:27:19.179981Z","iopub.status.idle":"2022-07-19T21:27:19.191206Z","shell.execute_reply.started":"2022-07-19T21:27:19.179934Z","shell.execute_reply":"2022-07-19T21:27:19.190103Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#replace some title with others to get easier info when look into Age\ndef user(title):\n    if title == \"Mr.\":\n        return title\n    elif title == \"Miss.\":\n        return title\n    elif title == \"Mrs.\":\n        return title\n    elif title == \"Master.\":\n        return title\n    else:\n        return \"others\"\ndf[\"Title\"]=df[\"Title\"].apply(user)    ","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.192367Z","iopub.execute_input":"2022-07-19T21:27:19.192884Z","iopub.status.idle":"2022-07-19T21:27:19.201155Z","shell.execute_reply.started":"2022-07-19T21:27:19.192852Z","shell.execute_reply":"2022-07-19T21:27:19.200424Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df[\"Title\"].value_counts()\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.202304Z","iopub.execute_input":"2022-07-19T21:27:19.202754Z","iopub.status.idle":"2022-07-19T21:27:19.215805Z","shell.execute_reply.started":"2022-07-19T21:27:19.202726Z","shell.execute_reply":"2022-07-19T21:27:19.215072Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.groupby(\"Title\")[\"Age\"].mean()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.216779Z","iopub.execute_input":"2022-07-19T21:27:19.217329Z","iopub.status.idle":"2022-07-19T21:27:19.230258Z","shell.execute_reply.started":"2022-07-19T21:27:19.217300Z","shell.execute_reply":"2022-07-19T21:27:19.229252Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#replace the null values with the average of each title\ndf.loc[(df[\"Age\"].isnull()) & (df[\"Title\"]==\"Master.\"), 'Age'] = 4.57\ndf.loc[(df[\"Age\"].isnull()) & (df[\"Title\"]==\"Miss.\"), 'Age'] = 21.84\ndf.loc[(df[\"Age\"].isnull()) & (df[\"Title\"]==\"Mr.\"), 'Age'] = 32.38\ndf.loc[(df[\"Age\"].isnull()) & (df[\"Title\"]==\"Mrs.\"), 'Age'] = 36.18\ndf.loc[(df[\"Age\"].isnull()) & (df[\"Title\"]==\"others\"), 'Age'] = 36.6","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.231501Z","iopub.execute_input":"2022-07-19T21:27:19.232264Z","iopub.status.idle":"2022-07-19T21:27:19.245560Z","shell.execute_reply.started":"2022-07-19T21:27:19.232222Z","shell.execute_reply":"2022-07-19T21:27:19.244525Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#drop cabin column not useful\ndf.drop(columns=\"Cabin\",inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.246875Z","iopub.execute_input":"2022-07-19T21:27:19.247786Z","iopub.status.idle":"2022-07-19T21:27:19.256338Z","shell.execute_reply.started":"2022-07-19T21:27:19.247742Z","shell.execute_reply":"2022-07-19T21:27:19.255509Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#fill missing value in Embarked column\ndf[\"Embarked\"]=df[\"Embarked\"].fillna(\"S\")","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.259608Z","iopub.execute_input":"2022-07-19T21:27:19.259926Z","iopub.status.idle":"2022-07-19T21:27:19.268940Z","shell.execute_reply.started":"2022-07-19T21:27:19.259898Z","shell.execute_reply":"2022-07-19T21:27:19.267853Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# let's check if there any missing value or not\ndf.isnull().sum()","metadata":{"scrolled":true,"execution":{"iopub.status.busy":"2022-07-19T21:27:19.270548Z","iopub.execute_input":"2022-07-19T21:27:19.271624Z","iopub.status.idle":"2022-07-19T21:27:19.283628Z","shell.execute_reply.started":"2022-07-19T21:27:19.271579Z","shell.execute_reply":"2022-07-19T21:27:19.282613Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h3 id=\"eda\">Exploratory_Data Analysis\n","metadata":{}},{"cell_type":"markdown","source":"<ul><li>Explore our dataset if there are any outliers or find out any value that we didn't detect when we do any numerical computation","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=[8,6])\nsns.set_theme(style=\"darkgrid\")\nsns.countplot(data=df,x=\"Survived\")\nplt.xticks([0,1],[\"Not_Survived\",\"Survived\"])\nplt.grid(True)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.285822Z","iopub.execute_input":"2022-07-19T21:27:19.286863Z","iopub.status.idle":"2022-07-19T21:27:19.437588Z","shell.execute_reply.started":"2022-07-19T21:27:19.286829Z","shell.execute_reply":"2022-07-19T21:27:19.436303Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=[8,6])\nexplode = (0,0)\nlabels =[\"Not_Survived\",\"Survived\"]\ncolors = ( \"#FF7F0E\", \"#1F77B4\")\nplt.pie(df[\"Survived\"].value_counts(), autopct='%1.1f%%',labels=labels,explode=explode,shadow=True, startangle=90,colors=colors)\nplt.legend()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.439414Z","iopub.execute_input":"2022-07-19T21:27:19.440652Z","iopub.status.idle":"2022-07-19T21:27:19.671123Z","shell.execute_reply.started":"2022-07-19T21:27:19.440595Z","shell.execute_reply":"2022-07-19T21:27:19.669905Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig1, ax1 = plt.subplots(1, 2, figsize=(20, 7))\n\nsns.histplot(data=df, x=\"Survived\", ax=ax1[0])\ndf[\"Survived\"].value_counts().plot.pie(shadow=True, autopct=\"%1.1f%%\", explode=[0.1, 0], ax=ax1[1])\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:19.672665Z","iopub.execute_input":"2022-07-19T21:27:19.673330Z","iopub.status.idle":"2022-07-19T21:27:20.034437Z","shell.execute_reply.started":"2022-07-19T21:27:19.673284Z","shell.execute_reply":"2022-07-19T21:27:20.033268Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**the people who not survived more than the people who survived**","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=[8,6])\nexplode = (0, 0.1, 0)\nlabels =['Thrid', 'First','Second']\ncolors = ( \"orange\", \"cyan\", \"brown\")\nplt.pie(df[\"Pclass\"].value_counts(), autopct='%1.1f%%',labels=labels,explode=explode,shadow=True, startangle=90,colors=colors)\nplt.legend()\nplt.show()","metadata":{"scrolled":true,"execution":{"iopub.status.busy":"2022-07-19T21:27:20.035545Z","iopub.execute_input":"2022-07-19T21:27:20.035828Z","iopub.status.idle":"2022-07-19T21:27:20.269987Z","shell.execute_reply.started":"2022-07-19T21:27:20.035803Z","shell.execute_reply":"2022-07-19T21:27:20.268817Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig2, ax2 = plt.subplots(1, 2, figsize=(20, 7))\n\nsns.countplot(data=df, x=\"Pclass\", ax=ax2[0])\ndf[\"Pclass\"].value_counts().plot.pie(shadow=True, autopct=\"%1.1f%%\", ax=ax2[1])\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:20.271577Z","iopub.execute_input":"2022-07-19T21:27:20.272802Z","iopub.status.idle":"2022-07-19T21:27:20.505269Z","shell.execute_reply.started":"2022-07-19T21:27:20.272751Z","shell.execute_reply":"2022-07-19T21:27:20.504385Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Thrid calss has the majority**","metadata":{}},{"cell_type":"code","source":"fig1, ax1 = plt.subplots(1, 2, figsize=(20, 7))\n\nsns.histplot(data=df, x=\"Sex\", ax=ax1[0])\ndf[\"Sex\"].value_counts().plot.pie(shadow=True, autopct=\"%1.1f%%\", explode=[0.1, 0], ax=ax1[1])\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:20.506572Z","iopub.execute_input":"2022-07-19T21:27:20.507599Z","iopub.status.idle":"2022-07-19T21:27:20.912310Z","shell.execute_reply.started":"2022-07-19T21:27:20.507563Z","shell.execute_reply":"2022-07-19T21:27:20.911204Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**male are more than female in this trip**","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=[10,8])\nsns.countplot(data=df,x=\"Title\",order=df[\"Title\"].value_counts().index,palette=\"rocket\")\nplt.grid(True)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:20.913649Z","iopub.execute_input":"2022-07-19T21:27:20.914038Z","iopub.status.idle":"2022-07-19T21:27:21.102831Z","shell.execute_reply.started":"2022-07-19T21:27:20.914007Z","shell.execute_reply":"2022-07-19T21:27:21.102079Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**It is natural that more men than women on the trip, those who have a title MR. are the majority**","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=[12,6])\nax=sns.histplot(data=df,x=\"Age\",kde=True)\nplt.grid(True)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:21.103864Z","iopub.execute_input":"2022-07-19T21:27:21.104371Z","iopub.status.idle":"2022-07-19T21:27:21.414673Z","shell.execute_reply.started":"2022-07-19T21:27:21.104332Z","shell.execute_reply":"2022-07-19T21:27:21.413604Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**person with 35 years old has majority in this trip**","metadata":{}},{"cell_type":"code","source":"df_2=df[[\"Age\",\"Survived\",\"Pclass\",\"Parch\"]]\nsns.pairplot(data=df_2,hue=\"Survived\");","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:21.420744Z","iopub.execute_input":"2022-07-19T21:27:21.421074Z","iopub.status.idle":"2022-07-19T21:27:23.968964Z","shell.execute_reply.started":"2022-07-19T21:27:21.421044Z","shell.execute_reply":"2022-07-19T21:27:23.967812Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"corr = df.corr()\ncorr","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:23.970345Z","iopub.execute_input":"2022-07-19T21:27:23.970663Z","iopub.status.idle":"2022-07-19T21:27:23.985166Z","shell.execute_reply.started":"2022-07-19T21:27:23.970634Z","shell.execute_reply":"2022-07-19T21:27:23.983996Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig, ax = plt.subplots(figsize=(20, 7))\ndataplot = sns.heatmap(data=corr, annot=True,cmap=\"coolwarm\",center=0, ax=ax)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:23.986582Z","iopub.execute_input":"2022-07-19T21:27:23.987450Z","iopub.status.idle":"2022-07-19T21:27:24.455138Z","shell.execute_reply.started":"2022-07-19T21:27:23.987412Z","shell.execute_reply":"2022-07-19T21:27:24.453971Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head(4)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:24.456620Z","iopub.execute_input":"2022-07-19T21:27:24.457131Z","iopub.status.idle":"2022-07-19T21:27:24.473559Z","shell.execute_reply.started":"2022-07-19T21:27:24.457085Z","shell.execute_reply":"2022-07-19T21:27:24.472571Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig,axes=plt.subplots(1,3,figsize=[16,5])\nfig.suptitle('Survived denpending on Age,Sex,Pcclass')\nsns.histplot(ax=axes[0],x=\"Age\",hue=\"Survived\",data=df,kde=True)\nsns.countplot(ax=axes[1],x=\"Sex\",hue=\"Survived\",data=df)\nsns.countplot(ax=axes[2],x=\"Pclass\",hue=\"Survived\",data=df)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:24.474837Z","iopub.execute_input":"2022-07-19T21:27:24.475142Z","iopub.status.idle":"2022-07-19T21:27:25.088653Z","shell.execute_reply.started":"2022-07-19T21:27:24.475114Z","shell.execute_reply":"2022-07-19T21:27:25.087511Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<ul>\n<li>We note that the majority of survivors are female\n<li>between 20 years old and 40 years old They were the most survivors\n<li>We note that the passengers in the first class are the most survivors in the ship accident. It may be that it was safer","metadata":{}},{"cell_type":"code","source":"df.head(1)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:25.090286Z","iopub.execute_input":"2022-07-19T21:27:25.090952Z","iopub.status.idle":"2022-07-19T21:27:25.106236Z","shell.execute_reply.started":"2022-07-19T21:27:25.090908Z","shell.execute_reply":"2022-07-19T21:27:25.104894Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#he number of siblings\nsns.violinplot(data=df, x=\"Sex\", y=\"Age\", hue=\"Survived\", split=True)\nplt.grid(True)\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:25.108916Z","iopub.execute_input":"2022-07-19T21:27:25.109357Z","iopub.status.idle":"2022-07-19T21:27:25.353078Z","shell.execute_reply.started":"2022-07-19T21:27:25.109314Z","shell.execute_reply":"2022-07-19T21:27:25.351817Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Children survival rate for both gender seems to be good, even though the survival rate for boys is higher. For old people (Age > 60), the survival rate for old men tends to be lower, in contrast to the survival rate for old women which tends to be higher.\n\n","metadata":{}},{"cell_type":"code","source":"fig,axes=plt.subplots(1,3,figsize=[16,5])\nfig.suptitle('Survived denpending on Age,Sex,Pcclass')\nsns.histplot(ax=axes[0],x=\"Fare\",hue=\"Survived\",data=df,kde=True)\nsns.countplot(ax=axes[1],x=\"SibSp\",hue=\"Survived\",data=df)\nsns.countplot(ax=axes[2],x=\"Embarked\",hue=\"Survived\",data=df)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:25.354830Z","iopub.execute_input":"2022-07-19T21:27:25.355163Z","iopub.status.idle":"2022-07-19T21:27:26.474845Z","shell.execute_reply.started":"2022-07-19T21:27:25.355133Z","shell.execute_reply":"2022-07-19T21:27:26.473808Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h4>Conclusion What we got","metadata":{}},{"cell_type":"markdown","source":"<ol>\n<li>Apparently, passengers traveling with small numbers of the family have a higher chance of survival. Also, a large number of children (age greater than or equal 10) survived this tragedy,while passengers over their age tend not to survive.\n<li>We can also see that the number of female survivors was much greater than the number of males (the first symbol of women and children).\n<li>The passengers from Port C seemed to be more fortunate as many of them survived.\n<li>P-class also plays a big role here because most passengers of P-class 1 manage to survive or have a higher priority to be rescued, while passengers of P-class 3 tend not to survive.","metadata":{}},{"cell_type":"markdown","source":"<h3 id=\"Ques\">Logistics regression","metadata":{}},{"cell_type":"code","source":"df.head(3)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.476146Z","iopub.execute_input":"2022-07-19T21:27:26.476499Z","iopub.status.idle":"2022-07-19T21:27:26.491088Z","shell.execute_reply.started":"2022-07-19T21:27:26.476470Z","shell.execute_reply":"2022-07-19T21:27:26.489985Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#drop unuseful column \ndf.drop(columns=[\"PassengerId\",\"Ticket\",\"Title\"],inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.492447Z","iopub.execute_input":"2022-07-19T21:27:26.492823Z","iopub.status.idle":"2022-07-19T21:27:26.501106Z","shell.execute_reply.started":"2022-07-19T21:27:26.492791Z","shell.execute_reply":"2022-07-19T21:27:26.500265Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df[[\"female\",\"male\"]]=pd.get_dummies(df[\"Sex\"])\ndf[[\"C\",\"Q\",\"S\"]]=pd.get_dummies(df[\"Embarked\"])","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.502545Z","iopub.execute_input":"2022-07-19T21:27:26.502962Z","iopub.status.idle":"2022-07-19T21:27:26.518226Z","shell.execute_reply.started":"2022-07-19T21:27:26.502912Z","shell.execute_reply":"2022-07-19T21:27:26.517279Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#drop sex and Embarked columns we will not use them again\ndf.drop(columns=[\"Sex\",\"Embarked\"],inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.519555Z","iopub.execute_input":"2022-07-19T21:27:26.520425Z","iopub.status.idle":"2022-07-19T21:27:26.526013Z","shell.execute_reply.started":"2022-07-19T21:27:26.520389Z","shell.execute_reply":"2022-07-19T21:27:26.525275Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#features that usues to prdecit\nX=df.drop(columns=[\"Survived\"])\n#\nY=df[\"Survived\"]\nX.head(2)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.527230Z","iopub.execute_input":"2022-07-19T21:27:26.527520Z","iopub.status.idle":"2022-07-19T21:27:26.544459Z","shell.execute_reply.started":"2022-07-19T21:27:26.527494Z","shell.execute_reply":"2022-07-19T21:27:26.543629Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Now that we have our attributes and labels, the next step is to split this data into training and test sets. We'll do this by using Scikit-Learn's built-in train_test_split() method","metadata":{}},{"cell_type":"code","source":"X_train,X_test,y_train,y_test=train_test_split(X,Y,test_size=.30,random_state=42)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.545328Z","iopub.execute_input":"2022-07-19T21:27:26.545658Z","iopub.status.idle":"2022-07-19T21:27:26.552452Z","shell.execute_reply.started":"2022-07-19T21:27:26.545629Z","shell.execute_reply":"2022-07-19T21:27:26.551634Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### FOLLOW FOUR STEPS","metadata":{}},{"cell_type":"markdown","source":"<ol>\n<li>choose Model\n<li>fit Model\n<li>predict Model\n<li>Evaluate Model","metadata":{}},{"cell_type":"code","source":"from sklearn.preprocessing import StandardScaler#scaling the features\nscaler= StandardScaler()\nscaler.fit(X_train)\nX_train = scaler.transform(X_train)\nX_test = scaler.transform(X_test)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.553588Z","iopub.execute_input":"2022-07-19T21:27:26.553877Z","iopub.status.idle":"2022-07-19T21:27:26.571677Z","shell.execute_reply.started":"2022-07-19T21:27:26.553851Z","shell.execute_reply":"2022-07-19T21:27:26.570566Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.linear_model import LogisticRegression\nmodel = LogisticRegression()\nmodel.fit(X_train,y_train)\n\ny_pred = model.predict(X_test)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.572950Z","iopub.execute_input":"2022-07-19T21:27:26.573486Z","iopub.status.idle":"2022-07-19T21:27:26.586728Z","shell.execute_reply.started":"2022-07-19T21:27:26.573442Z","shell.execute_reply":"2022-07-19T21:27:26.585565Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"accuracy_score(y_test, y_pred)\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.588128Z","iopub.execute_input":"2022-07-19T21:27:26.588784Z","iopub.status.idle":"2022-07-19T21:27:26.596941Z","shell.execute_reply.started":"2022-07-19T21:27:26.588745Z","shell.execute_reply":"2022-07-19T21:27:26.596156Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"confusion_matrix(y_test, y_pred)\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.598202Z","iopub.execute_input":"2022-07-19T21:27:26.598565Z","iopub.status.idle":"2022-07-19T21:27:26.610150Z","shell.execute_reply.started":"2022-07-19T21:27:26.598536Z","shell.execute_reply":"2022-07-19T21:27:26.609325Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(classification_report(y_test, y_pred))\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.611504Z","iopub.execute_input":"2022-07-19T21:27:26.611964Z","iopub.status.idle":"2022-07-19T21:27:26.627687Z","shell.execute_reply.started":"2022-07-19T21:27:26.611932Z","shell.execute_reply":"2022-07-19T21:27:26.626303Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df = pd.read_csv('/kaggle/input/titanic/test.csv')\ntest_df.head(4)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.628952Z","iopub.execute_input":"2022-07-19T21:27:26.630093Z","iopub.status.idle":"2022-07-19T21:27:26.653094Z","shell.execute_reply.started":"2022-07-19T21:27:26.630048Z","shell.execute_reply":"2022-07-19T21:27:26.651928Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df.isnull().sum()\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.654129Z","iopub.execute_input":"2022-07-19T21:27:26.654847Z","iopub.status.idle":"2022-07-19T21:27:26.664392Z","shell.execute_reply.started":"2022-07-19T21:27:26.654811Z","shell.execute_reply":"2022-07-19T21:27:26.663361Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# split the name columns to title of names like MR,MRS\ntest_df[\"Title\"]=test_df[\"Name\"].str.split(expand=True)[1]\n#drop the name column it's not useful anymore\ntest_df.drop(columns=\"Name\",inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.665895Z","iopub.execute_input":"2022-07-19T21:27:26.666388Z","iopub.status.idle":"2022-07-19T21:27:26.676747Z","shell.execute_reply.started":"2022-07-19T21:27:26.666354Z","shell.execute_reply":"2022-07-19T21:27:26.675747Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#replace some title with others to get easier info when look into Age\ndef user(title):\n    if title == \"Mr.\":\n        return title\n    elif title == \"Miss.\":\n        return title\n    elif title == \"Mrs.\":\n        return title\n    elif title == \"Master.\":\n        return title\n    else:\n        return \"others\"\ntest_df[\"Title\"]=test_df[\"Title\"].apply(user) ","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.677940Z","iopub.execute_input":"2022-07-19T21:27:26.678426Z","iopub.status.idle":"2022-07-19T21:27:26.685670Z","shell.execute_reply.started":"2022-07-19T21:27:26.678397Z","shell.execute_reply":"2022-07-19T21:27:26.684725Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df[\"Title\"].value_counts()\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.687034Z","iopub.execute_input":"2022-07-19T21:27:26.687447Z","iopub.status.idle":"2022-07-19T21:27:26.698334Z","shell.execute_reply.started":"2022-07-19T21:27:26.687408Z","shell.execute_reply":"2022-07-19T21:27:26.697263Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df.groupby(\"Title\")[\"Age\"].mean()","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.700874Z","iopub.execute_input":"2022-07-19T21:27:26.701806Z","iopub.status.idle":"2022-07-19T21:27:26.711889Z","shell.execute_reply.started":"2022-07-19T21:27:26.701762Z","shell.execute_reply":"2022-07-19T21:27:26.710942Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#replace the null values with the average of each title\ntest_df.loc[(test_df[\"Age\"].isnull()) & (test_df[\"Title\"]==\"Master.\"), 'Age'] = 7.15\ntest_df.loc[(test_df[\"Age\"].isnull()) & (test_df[\"Title\"]==\"Miss.\"), 'Age'] = 21.84\ntest_df.loc[(test_df[\"Age\"].isnull()) & (test_df[\"Title\"]==\"Mr.\"), 'Age'] = 32.38\ntest_df.loc[(test_df[\"Age\"].isnull()) & (test_df[\"Title\"]==\"Mrs.\"), 'Age'] = 39\ntest_df.loc[(test_df[\"Age\"].isnull()) & (test_df[\"Title\"]==\"others\"), 'Age'] = 34.8","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.713003Z","iopub.execute_input":"2022-07-19T21:27:26.713488Z","iopub.status.idle":"2022-07-19T21:27:26.728108Z","shell.execute_reply.started":"2022-07-19T21:27:26.713461Z","shell.execute_reply":"2022-07-19T21:27:26.727077Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#drop cabin column not useful\ntest_df.drop(columns=\"Cabin\",inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.729918Z","iopub.execute_input":"2022-07-19T21:27:26.730778Z","iopub.status.idle":"2022-07-19T21:27:26.745037Z","shell.execute_reply.started":"2022-07-19T21:27:26.730732Z","shell.execute_reply":"2022-07-19T21:27:26.744168Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df.head(2)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.746245Z","iopub.execute_input":"2022-07-19T21:27:26.746771Z","iopub.status.idle":"2022-07-19T21:27:26.764492Z","shell.execute_reply.started":"2022-07-19T21:27:26.746741Z","shell.execute_reply":"2022-07-19T21:27:26.763711Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df[[\"female\",\"male\"]]=pd.get_dummies(test_df[\"Sex\"])\ntest_df[[\"C\",\"Q\",\"S\"]]=pd.get_dummies(test_df[\"Embarked\"])\n#drop sex and Embarked columns we will not use them again\ntest_df.drop(columns=[\"Sex\",\"Embarked\",\"Ticket\",\"Title\"],inplace=True)\ntest_df.head(2)","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.765577Z","iopub.execute_input":"2022-07-19T21:27:26.766009Z","iopub.status.idle":"2022-07-19T21:27:26.783010Z","shell.execute_reply.started":"2022-07-19T21:27:26.765982Z","shell.execute_reply":"2022-07-19T21:27:26.782285Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X= df[[\"Pclass\",\"C\",\"Q\",\"S\",\"SibSp\",\"Age\",\"female\",\"male\"]]\ny= df[\"Survived\"]\ntest= test_df[[\"Pclass\",\"C\",\"Q\",\"S\",\"SibSp\",\"Age\",\"female\",\"male\"]]","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.784074Z","iopub.execute_input":"2022-07-19T21:27:26.784513Z","iopub.status.idle":"2022-07-19T21:27:26.790096Z","shell.execute_reply.started":"2022-07-19T21:27:26.784486Z","shell.execute_reply":"2022-07-19T21:27:26.789404Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.791235Z","iopub.execute_input":"2022-07-19T21:27:26.791498Z","iopub.status.idle":"2022-07-19T21:27:26.800844Z","shell.execute_reply.started":"2022-07-19T21:27:26.791473Z","shell.execute_reply":"2022-07-19T21:27:26.800091Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.model_selection import GridSearchCV\nfrom sklearn.ensemble import RandomForestClassifier\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.802088Z","iopub.execute_input":"2022-07-19T21:27:26.802952Z","iopub.status.idle":"2022-07-19T21:27:26.861432Z","shell.execute_reply.started":"2022-07-19T21:27:26.802917Z","shell.execute_reply":"2022-07-19T21:27:26.860531Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"grid_params = {'n_estimators': [90,100, 110, 120], 'max_depth': [2,3,5,10,15] }\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.862509Z","iopub.execute_input":"2022-07-19T21:27:26.863478Z","iopub.status.idle":"2022-07-19T21:27:26.868311Z","shell.execute_reply.started":"2022-07-19T21:27:26.863443Z","shell.execute_reply":"2022-07-19T21:27:26.867438Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model_2 = RandomForestClassifier(n_estimators=120, max_depth=5)\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.869953Z","iopub.execute_input":"2022-07-19T21:27:26.870716Z","iopub.status.idle":"2022-07-19T21:27:26.879458Z","shell.execute_reply.started":"2022-07-19T21:27:26.870672Z","shell.execute_reply":"2022-07-19T21:27:26.878698Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model_2.fit(X_train, y_train)\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:26.880669Z","iopub.execute_input":"2022-07-19T21:27:26.881376Z","iopub.status.idle":"2022-07-19T21:27:27.055602Z","shell.execute_reply.started":"2022-07-19T21:27:26.881334Z","shell.execute_reply":"2022-07-19T21:27:27.054513Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_pred = model_2.predict(X_test)\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:27.056768Z","iopub.execute_input":"2022-07-19T21:27:27.057080Z","iopub.status.idle":"2022-07-19T21:27:27.081930Z","shell.execute_reply.started":"2022-07-19T21:27:27.057052Z","shell.execute_reply":"2022-07-19T21:27:27.081112Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"accuracy_score(y_test, y_pred)\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:27.082919Z","iopub.execute_input":"2022-07-19T21:27:27.083630Z","iopub.status.idle":"2022-07-19T21:27:27.090644Z","shell.execute_reply.started":"2022-07-19T21:27:27.083598Z","shell.execute_reply":"2022-07-19T21:27:27.089616Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(classification_report(y_test,y_pred))\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:27.092142Z","iopub.execute_input":"2022-07-19T21:27:27.092722Z","iopub.status.idle":"2022-07-19T21:27:27.103052Z","shell.execute_reply.started":"2022-07-19T21:27:27.092693Z","shell.execute_reply":"2022-07-19T21:27:27.102278Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"prediction = model_2.predict(test)\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:27.104639Z","iopub.execute_input":"2022-07-19T21:27:27.105180Z","iopub.status.idle":"2022-07-19T21:27:27.130681Z","shell.execute_reply.started":"2022-07-19T21:27:27.105150Z","shell.execute_reply":"2022-07-19T21:27:27.129855Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission = pd.read_csv('/kaggle/input/titanic/gender_submission.csv')\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:27.131823Z","iopub.execute_input":"2022-07-19T21:27:27.132164Z","iopub.status.idle":"2022-07-19T21:27:27.142170Z","shell.execute_reply.started":"2022-07-19T21:27:27.132133Z","shell.execute_reply":"2022-07-19T21:27:27.141257Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission['Survived'] = prediction\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:27.143478Z","iopub.execute_input":"2022-07-19T21:27:27.144575Z","iopub.status.idle":"2022-07-19T21:27:27.149646Z","shell.execute_reply.started":"2022-07-19T21:27:27.144532Z","shell.execute_reply":"2022-07-19T21:27:27.148914Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission.to_csv('submission.csv', index=False)\n","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:27.151155Z","iopub.execute_input":"2022-07-19T21:27:27.151814Z","iopub.status.idle":"2022-07-19T21:27:27.162183Z","shell.execute_reply.started":"2022-07-19T21:27:27.151773Z","shell.execute_reply":"2022-07-19T21:27:27.161395Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission","metadata":{"execution":{"iopub.status.busy":"2022-07-19T21:27:27.163732Z","iopub.execute_input":"2022-07-19T21:27:27.164592Z","iopub.status.idle":"2022-07-19T21:27:27.176717Z","shell.execute_reply.started":"2022-07-19T21:27:27.164543Z","shell.execute_reply":"2022-07-19T21:27:27.175509Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}