{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "#Introduction\n", "When i started participating in Kaggle competitions. I started with this problem.I feel this is a very \n", "easy problem to start learning Data Science. So i thought let me share how i approached this problem. Please feel\n", "free to share your comments. I have used IPython to solve this problem. then converted ipython notebook into html file. So if you feel the UI of this page is screwed up. you can see this notebook here " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The Problem Statement is very simple. By seeing some example data about people who survived and who died in Titanic,we need to predict that given a new person's data , wether that person will be saved or not. You can read more about this problem statement here\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#Data\n", "\n", "You can also get the data from same location. There are two important files there.\n", "\n", "1. train.csv\n", "2. test.csv\n", "\n", "train.csv is the file which contain examples. we will analyze this data and create a mode which will know pattrens\n", "about people who were saved and who died. This execise needs python, ipython, numpy, pandas, matplotlib, sklearn to\n", "be installed on your machine. I will shortly create a post which has details to install all these.\n", "\n", "Before Starting, Let us first try to know that what kind of columns we have in our data.\n", "\n", "survival Survival\n", " (0 = No; 1 = Yes)\n", "pclass Passenger Class\n", " (1 = 1st; 2 = 2nd; 3 = 3rd)\n", "name Name\n", "sex Sex\n", "age Age\n", "sibsp Number of Siblings/Spouses Aboard\n", "parch Number of Parents/Children Aboard\n", "ticket Ticket Number\n", "fare Passenger Fare\n", "cabin Cabin\n", "embarked Port of Embarkation\n", " (C = Cherbourg; Q = Queenstown; S = Southampton)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let us Start the fun now. First we will import some libraries\n", "\n", "##Some Imports" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import sklearn\n", "import matplotlib.pyplot as plt\n", "\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "we have imported pandas, numpy, sklearn and matplotlib\n", "pandas is a great library to load and do EDA on data. sklearn will help us in different transformations and \n", "creating a model. matplotlib help us ploting data for visulaizations. \n", "\n", "\"%matplotlib inline\" is a magic function in IPython. it helps us intialize matplotlib and display created plots \n", "in the notebook itself instead of a separate window. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Read Data\n", "\n", "Let us Now read the csv files" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "df = pd.read_csv('./input/train.csv')\n", "test = pd.read_csv('./input/test.csv')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Start Exploring\n", "\n", "To get some information about loaded data, type following" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Int64Index: 891 entries, 0 to 890\n", "Data columns (total 12 columns):\n", "PassengerId 891 non-null int64\n", "Survived 891 non-null int64\n", "Pclass 891 non-null int64\n", "Name 891 non-null object\n", "Sex 891 non-null object\n", "Age 714 non-null float64\n", "SibSp 891 non-null int64\n", "Parch 891 non-null int64\n", "Ticket 891 non-null object\n", "Fare 891 non-null float64\n", "Cabin 204 non-null object\n", "Embarked 889 non-null object\n", "dtypes: float64(2), int64(5), object(5)\n", "memory usage: 73.1+ KB\n" ] } ], "source": [ "df.info()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To get basic parameters about different variables call describe function." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PassengerIdSurvivedPclassAgeSibSpParchFare
count891.000000891.000000891.000000714.000000891.000000891.000000891.000000
mean446.0000000.3838382.30864229.6991180.5230080.38159432.204208
std257.3538420.4865920.83607114.5264971.1027430.80605749.693429
min1.0000000.0000001.0000000.4200000.0000000.0000000.000000
25%223.5000000.0000002.00000020.1250000.0000000.0000007.910400
50%446.0000000.0000003.00000028.0000000.0000000.00000014.454200
75%668.5000001.0000003.00000038.0000001.0000000.00000031.000000
max891.0000001.0000003.00000080.0000008.0000006.000000512.329200
\n", "
" ], "text/plain": [ " PassengerId Survived Pclass Age SibSp \\\n", "count 891.000000 891.000000 891.000000 714.000000 891.000000 \n", "mean 446.000000 0.383838 2.308642 29.699118 0.523008 \n", "std 257.353842 0.486592 0.836071 14.526497 1.102743 \n", "min 1.000000 0.000000 1.000000 0.420000 0.000000 \n", "25% 223.500000 0.000000 2.000000 20.125000 0.000000 \n", "50% 446.000000 0.000000 3.000000 28.000000 0.000000 \n", "75% 668.500000 1.000000 3.000000 38.000000 1.000000 \n", "max 891.000000 1.000000 3.000000 80.000000 8.000000 \n", "\n", " Parch Fare \n", "count 891.000000 891.000000 \n", "mean 0.381594 32.204208 \n", "std 0.806057 49.693429 \n", "min 0.000000 0.000000 \n", "25% 0.000000 7.910400 \n", "50% 0.000000 14.454200 \n", "75% 0.000000 31.000000 \n", "max 6.000000 512.329200 " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.describe()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Data Ploting as part of Exploration\n", "\n", "###Survived vs Died" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAAD7CAYAA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T7weeBt5TV10kydVV21ISfGExTaEPP/c+cGxOWz/GZhKqKmvt23BmnuQE8DPAu5K8DPw2\n8DBwMskDwDJwL0BVLSU5CSwBl4AHe5HaktRzE83Mp35RZ+Y7VD9mP33g2Jy2fozN9Wbmvgdckhpg\nmEtSAwxzSWqAYS5JDTDMJakBhrkkNcAwl6QGGOaS1ADDXJIaYJhLUgMMc0lqgGEuSQ0wzCWpAYa5\nJDXAMJekBhjmktQAw1ySGmCYS1IDDHNJaoBhLkkNMMwlqQGGuSQ1wDCXpAYY5pLUAMNckhpgmEtS\nAwxzSWqAYS5JDZhJmCc5kuRsknNJPj6La0iSrph6mCe5GfgD4AhwCPhQkvdN+zoaN9zqDkjXMNzq\nDuwYs5iZHwbOV9VyVV0E/gQ4OoPr6LLhVndAuobhVndgx5hFmO8HXh7bXunqJEkzMoswrxmcU5K0\njl0zOOcrwIGx7QOMZuffI8kMLj0LfennJ7e6AxPpz8+9D/ry/9Kx+WZI1XQn0kl2Af8G/BzwH8Dz\nwIeq6mtTvZAk6bKpz8yr6lKSjwJPATcDnzHIJWm2pj4zlyS9+WaxZq4Z6t6zf5Qr7xBaAU756kfa\n2fw4f490n6Y90W0+1z1uAk4kOb5lHZPWkeQjW92HncBllh5Jcg441H0Ya7x+N7BUVe/Zmp5J15bk\n5ao6sHFLbYbLLP3yf4yWV5avqt/X7ZO2RJKvrLP7h960juxghnm//DrwdJLzXPmU7QHgDuCjW9Yr\naRTYR4Bvr7HvH97kvuxIhnmPVNWTSX6E0f1v9jP6tO0rwJeq6tKWdk473V8Ab6+qF67ekeRvtqA/\nO45r5pLUAN/NIkkNMMwlqQGGuSQ1wDCXpAYY5pLUgP8HnwzsAi2ABXQAAAAASUVORK5CYII=\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df.Survived.value_counts().plot(kind='bar')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "###No of Males vs Females" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAAEYCAYAAACuiRYLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEUxJREFUeJzt3X+sZGV9x/H3B1ai0NaVaBZY1kgF1G0komFJf6XTlFDS\nNAt/NKAhlihp0pCKbbRxsaZc05QKSds0aYiprWZDgGZjlUBqZBfKpDU2UBWKsq4sxk1cdC9owWqt\ndjd8+8cc2OFy997L3pmde577fiUTznnOOXO+lzn7uc88z5m5qSokSf120qwLkCStnmEuSQ0wzCWp\nAYa5JDXAMJekBhjmktSAFYV5ko1JPp3k60n2Jrk4yelJ9iR5PMnuJBvH9r8hyf4k+5JcOr3yJUmw\n8p753wCfq6q3ABcA+4AdwJ6qOh+4v1snyVbgKmArcBlwaxLfAUjSFC0bskleDfxqVX0SoKqOVNUP\ngO3Azm63ncAV3fLlwJ1VdbiqDgBPANsmXbgk6aiV9JjPAZ5O8qkkX0nyiSSnAZuqar7bZx7Y1C2f\nBRwcO/4gsHliFUuSXmIlYb4BeDtwa1W9HfgfuiGV59XoOwGW+l4AvzNAkqZowwr2OQgcrKr/6NY/\nDdwAHEpyRlUdSnIm8FS3/Ulgy9jxZ3dtL0hiuEvScaiqLNa+bM+8qg4B305yftd0CfAYcA9wTdd2\nDXBXt3w38M4kpyQ5BzgPeGiR5/UxoceNN9448xp8+Fjs4bU52cdSVtIzB3gfcHuSU4BvAu8BTgZ2\nJbkWOABc2YX03iS7gL3AEeC6Wq4KSdKqrCjMq+o/gYsW2XTJMfa/CbhpFXVJkl4G7/9uwGAwmHUJ\n0qK8Nk+czGIEJIkjL5L0MiWhjncCVJK09hnmktSAld7Nsi4li76b0So4vCZNh2G+LMNncvzlKE2L\nwyyS1ADDXJIaYJhLUgMMc0lqgGEuSQ0wzCWpAYa5JDXAMJekBhjmktQAw1yS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hZ1n8G1NzjHZNmD1zSWqAPfMeSnI+cBPwC8Aru+aqKu8110wleRVwLaM/Gfkqul55Vb13\nlnWtB95n3k+fAj7O6P7dAbATuH2WBUmd24BNjP4G8JDR3zP40SwLWi8cZumhJF+pqrcn+WpVvXW8\nbda1aX1L8khVvS3Jo1V1QZJXAF+oqotnXVvrHGbpp58kORl4ovvu+O8Ap824JgmOfoz/B0neChwC\nXjfDetYNh1n66f2MxiPfB7wDuBq4ZqYVSSOfSHI68BHgbmAvcMtsS1ofHGbpoSQXMfoyozcwencV\n4LmqumCWdUmaHcO8h5I8DnwQ+BpjX7DlR6Y1a0leA/wuRzsaMLrT6vqZFbVOOGbeT09Xld9frrXo\nc8C/A49y9MNC9hhPAHvmPZTkUuAq4D6OTjhVVX1mdlVJ3lU1S4Z5DyW5HXgT8BgvHmZ5z8yKkoAk\nHwT+G7gH+Onz7VX1XzMrap0wzHsoyTeAN5cvntaY7lbZPwee5WhHw08nnwCOmffTFxl9XPqxWRci\nLfAB4I1V9b1ZF7LeGOb99IvAI0m+xdG3suWtiVoD9gP/O+si1iPDvJ8um3UB0jH8mFFH4wFe3NHw\n1sQpM8x7yPvJtYbd1T2en8/x+8xPECdAJU1UklOB11fVvlnXsp743SySJibJduBh4PPd+oVJ/IDb\nCWCYS5qkOeBi4BmAqnoY8LbEE8AwlzRJh6vq2QVtzy26pybKCVBJk/S1JFcDG5KcB1zP6HMRmjJ7\n5pJWLclt3eI3GX2g7afAnYw+2v+Hs6prPfFuFkmrlmQvcAmjic8Bo1sSn1d+N8v0OcwiaRI+DtzP\naLLzywu2FU6CTp09c0kTk+TjVfX7s65jPTLMJakBToBKUgMMc0lqgGEuSQ0wzCWpAYa5JDXg/wHg\nQTNinWrHYgAAAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df.Sex.value_counts().plot(kind='bar')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "###No of people who boarded from different points" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAAD9CAYAAABOd5eOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEHtJREFUeJzt3X+spFddx/H3p11qbYksG8ztdltDI11hRQM1rFFRBsWm\nEtgt/7QlxmywYEwj4B+Y3jXRXv7BUv8QjGmCCuSKdM0C0hSjsNvaEUxMK9CKcrvurslNuJW9bfkt\nENO1X/+Yp7vT2+Xe2b0zd7bnvl/JzZ7nPOeZc2Ym+5kzZ555JlWFJOm57YJpD0CStH6GuSQ1wDCX\npAYY5pLUAMNckhpgmEtSA9YM8yQ/keShob9vJXlHkm1JDic5muRQkq1Dx+xPcizJkSTXTvYuSJJy\nNueZJ7kAeBTYDbwdeKKq7khyK/DCqppNsgu4C3gVsAO4F9hZVU+NffSSJODsl1leBxyvqq8Ae4D5\nrn4euL4r7wUOVNWTVbUIHGcQ/pKkCTnbML8JONCVZ6pquSsvAzNd+XJgaeiYJQYzdEnShIwc5kku\nAt4IfGzlvhqs1ay2XuM1AyRpgracRdtfA75QVY9328tJLquqE0m2A4919Y8CVw4dd0VXd0oSw12S\nzkFV5Uz1Z7PM8mZOL7EA3APs68r7gLuH6m9KclGSq4CrgQfPMKBm/2677bapj8E/n7/N+Nf6c7ea\nkWbmSS5l8OHn24aqbwcOJrkZWARu6EJ6IclBYAE4CdxSa41CkrQuI4V5VX0XeNGKuq8zCPgztX8P\n8J51j06SNBK/AToBvV5v2kPQOvj8PXdt5ufurL40NLZOE1deJOksJaHG8AGoJOk8ZZhLUgMMc0lq\ngGEuSQ0wzCWpAYa5JDXAMJekBhjmktQAw1ySGmCYS1IDDHNJaoBhLkkNOJtfGnrOSs54XZqmeOEy\naXPbFGE+0HLYtf9iJWl1LrNIUgMMc0lqgGEuSQ0wzCW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iRJOmXsM/OqOpnkd4DPABcCHzTIJWmyxj4zlyRtPL8Bqk0rydVJXn2G+lcn+fFpjEln\nJ8nFSV6e5BVJLp32eKbJMF+HJLuTbB/a3pfkniR/mmTbNMemkbwP+PYZ6r/d7dN5KsnzktzB4OSK\nvwI+BCwmeX+3b5N9UdEwX68PAP8LkOSXgNuBeQZh8OdTHJdGM1NVX1pZ2dVdNYXxaHR/DGwDrqqq\na6rqGuDHgUuAvwY+Ns3BTcMkTk3cTC6oqq935RuBD1TVJ4BPJPm3KY5Lo9m6yr6LN2wUOhdvAHZW\n1VNPV1TVt5P8NvAE8PqpjWxKnJmvz4VJnteVXwfcP7TPF8rz3+eT/NbKyiRvA74whfFodE8NB/nT\nqur/gMer6l+mMKapMnDW5wDwT0meAL4HfA4GH6wB35zmwDSS3wU+meTXOR3ePwP8EPCmqY1Ko3gk\nyb6qmh+uTPIbwKY8FdpTE9cpyc8BlwGHquq7Xd1O4PlV9cWpDk5ryuDre68FXs7gUhRfrqp/nO6o\ntJYkVwB/C3yfZ74QXwK8qaqe9a3z1hnmkp6TuhfiXwZ+ksEL8UJV3TfdUU2PYS5JDfADUElqgGEu\nSQ0wzCWpAYa5JDXAMJekBvw/O1qYsGFM738AAAAASUVORK5CYII=\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df.Embarked.value_counts().plot(kind='bar')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "###No of people in different classes" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAAD7CAYAAACYLnSTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADZRJREFUeJzt3F+IpfV9x/H3R7eSpLbdSJr137YRoiQLDdqSpdDQnGBr\npQT1Ss1FuqTSG1sSCinu5qKu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u2kx4Ff\nBR4Cfh14sKr+aIHD0yYk+VhVfXHR49Daknwc+F3gGeA64BNVdf+w7GhVXbfI8S2CMd+EJMeA9wEX\nAcvAlVX1SpK3Ak9U1fsWOkCdtSTfqardG6+pRUjyLeCXq+rVJO8C/gb4y6r6k+0a83l8NHE7+b+q\nOgWcSvKvVfUKQFX9d5LXFjw2bSDJ0+ssfueWDURnI1X1KkBVLSUZAV9J8vNs/WchzwnGfHP+N8nb\nquqHwC++PjPJTsCYn/veycrfEHp5jWX/tMVj0Zl5Kcm1VfUUwHCG/mHgC6xcLW87xnxzPlhV/wNQ\nVZPx3gHsW8yQdAYeAi6uqqOrFyT5uwWMR9P7LeDk5IyqOplkH/BnixnSYnnPXJIa8KOJktSAMZek\nBoy5JDVgzCWpAWMuSQ38PxURp71PPXKOAAAAAElFTkSuQmCC\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df.Pclass.value_counts().plot(kind='bar')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "###Age distribution" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEACAYAAAC57G0KAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHbtJREFUeJzt3X+Q5HV95/HnC1ZM1IQRvVp+uJchUU6XQgejiJcffDFI\noZegV1cRuJhjo5erOpIo1pVx17tD/zLgnYRU7vjjostsLOXCqUcBGmTR/VjmEkUPVlfWDXBxTzCy\nqPgjl5Nzkff90d+ZaWanZz7znZ7+fD/N61HVtfP9dk/3s6a/85ned/f0KCIwM7Ppc1zpADMz2xxe\n4M3MppQXeDOzKeUF3sxsSnmBNzObUl7gzcym1KoLvKTdko5IOjC07xxJd0m6R9IXJL186Lxdku6X\ndEjShZsZbmZmq1vrEfwNwEX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eBz7GYMy9rq/nJBf4LwIvkDTb/vS8BLhlgre/XrcAl7cfX85g3l2UJAEfAA5GxHVDZ/WmVdJz\nF57Zl/STDOaG99CjRoCIeGdEbIuI0xn8V/3TEfGb9KxT0jMk/VT78TMZzI0P0LPOiHgYeFDSGe2u\nC4B7GcyOe9M55DKWxjPQs68ng1n7uZJ+sv2+v4DBiwHW9/Wc8BMHr2HwxMEDwK6ST2Is67qRwZzr\nRwyeJ/gtBk9y3AncB9wBzPSg8xcZzIv3M1g072Hw6p/etAJnAXe3jV8G3t7u703jCs3nAbf0sZPB\nbHt/e/rKwvdN3zrbppcweFL9SwwecZ7Y085nAt8GfmpoXx87f5/BD8kDwB7gaevt9C86mZlNKf/J\nPjOzKeUF3sxsSnmBNzObUl7gzcymlBd4M7Mp5QXezGxKeYE3M5tSXuDNzKbU/weK9l9FArwPiAAA\nAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df.Age.hist()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exploring Relationship between two variables\n", "\n", "### How many people survived in different classes" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Survived01
Pclass
180136
29787
3372119
\n", "
" ], "text/plain": [ "Survived 0 1\n", "Pclass \n", "1 80 136\n", "2 97 87\n", "3 372 119" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pclass_crosstab = pd.crosstab(df.Pclass,df.Survived)\n", "pclass_crosstab" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Lets explore by percentage" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Survived01
Pclass
10.3703700.629630
20.5271740.472826
30.7576370.242363
\n", "
" ], "text/plain": [ "Survived 0 1\n", "Pclass \n", "1 0.370370 0.629630\n", "2 0.527174 0.472826\n", "3 0.757637 0.242363" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pclass_pct = pclass_crosstab.div(pclass_crosstab.sum(1).astype(float) , axis=0)\n", "pclass_pct\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Lets Visualize the cross tab table" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW8AAAEKCAYAAADdBdT9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFqlJREFUeJzt3X2QXXV9x/H3x11AMEkhRiwJsWslUmJIiEIq1cLlobIo\nkNoKaywPUq2xEqAzdJrKSLkZJmWi0xkfgho0NUxFQwZaG5SYUevFtkmBhSVByUKCZiYPxKpBQiDQ\nbPj2j71Zbu7evWezuQ/7u/t5zezMPef89pzvOTf55JfzOw+KCMzMLC2va3YBZmZ2+BzeZmYJcnib\nmSXI4W1mliCHt5lZghzeZmYJygxvSZ2SeiVtlrSwwvJJkr4v6XFJP5X00bpUamZmA1TtOm9JbcBT\nwIXADuARYF5EbCppkweOiYhPS5pUbP/miOirZ+FmZmNZVs97DrAlIrZGxH5gJTC3rM2zwITi5wnA\nbxzcZmb11Z6xfAqwrWR6O/CHZW2+BvyHpJ3AeOCK2pVnZmaVZPW8h3Pv/M3A4xExGTgDuEPS+COu\nzMzMhpTV894BTC2Znkp/77vUHwGLASLiGUm/AE4FuksbSfJDVMzMRiAiVD4vq+fdDUyT1CHpaKAL\nWF3Wppf+AU0kvZn+4P75EAW07M+tt97a9Br84+9uLP60+vc3lKo974jok7QAWAu0AcsjYpOk+cXl\ny4B/BL4haUPxH4O/i4jdGf8omJnZEcg6bUJErAHWlM1bVvL518CltS/NzMyG4jssaySXyzW7BBsh\nf3dpG6vfX9WbdGq6ISkatS0zs1YhiagwYJl52sSsWaRBf16T5w6M1YrD20a1Vgq7VvzHyJrH57zN\nzBLk8DYzS5DD28wsQQ5vS87ixYuZMWMGs2bNYvbs2Tz88MNHvM7777+fJUuW1KA6GDduXE3WY1aN\nLxW0Uat4idQh89avX89NN93Egw8+yFFHHcXu3bt55ZVXOOmkkzLX19fXR3t7/cfox48fzwsvvDBo\nfqX9aUXNGJht5eM61KWC7nlbUnbt2sWkSZM46qijAJg4cSInnXQSHR0d7N7d/1SG7u5uzjvvPADy\n+TxXXXUV733ve7n66qs5++yzefLJJwfWl8vlePTRR1mxYgXXX389e/bsoaOjY2D5iy++yFve8hYO\nHDjAM888w8UXX8yZZ57JOeecw1NPPQXAL37xC84++2xmzpzJZz7zmQYdidEuGvgzNjm8LSnve9/7\n2LZtG6eeeirXXXcdP/nJT4Dqvb3e3l5+9KMf8a1vfYuuri5WrVoFwLPPPsuuXbt417veNdB2woQJ\nnHHGGRQKBQC++93v0tnZSVtbG5/4xCf40pe+RHd3N5/73Of41Kc+BcCNN97Iddddx8aNG5k8eXKd\n9tzsUA5vS8ob3vAGHn30Ue68807e9KY30dXVxYoVK4ZsL4nLLruMY445BoArrriCe++9F4BVq1Zx\n+eWXD/qdrq4u7rnnHgBWrlxJV1cXe/fuZd26dVx++eXMnj2bT37yk+zatQuAdevWMW/ePACuvPLK\nWu6u2ZB8k44l53Wvex3nnnsu5557LqeffjorVqygvb2dV199FYCXX375kPbHHXfcwOfJkyfzxje+\nkSeeeIJVq1axbFn/M9ZKe+6XXnopN998M8899xyPPfYY559/Pi+88AInnHACPT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uu4CXghM1dHxEbgQ5n5fETMycydEfEl4KeZ+Z36dvr2XXsstZM9b/WSIyNiCPgn4Bngb4D3A+v3\nhXNm/mac3zs9Iv6hHtZ/AMyvz/9H4JsR8Sf82w1tDwDXR8SfA/0GtzrFOyzVS3Y3PlwqIpKJn1uy\n72PnWuCizHysfrdlBSAz/ywizgE+CjwcEWdm5m0R8VPg94F7I+KazPzRNOyLNCl73up1fwdcGhHH\nAUTEsWOW7Qv12cD2iJgJXD66MOJ3MvOhzLwB+BfgpIg4GXgmM78M/B/g9HbshNTInrd6yX4ncDLz\n8YhYCfx9ROwFfgb8UUP7zwEPMhLQDzIS5gD/KyJOZSTk/zYzN0bEdcAVEbEHeB5YOW17I03CE5aS\nVCCHTSSpQIa3JBXI8JakAhneklQgw1uSCmR4S1KBDG9JKpDhLUkF+v8Ow6Eqj+JTWgAAAABJRU5E\nrkJggg==\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "pclass_pct.plot(kind='bar')\n", "pclass_pct.plot(kind='bar' , stacked=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "###Exploring how much gender played any part in saving peoples" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First get unique genders and the map the gender column to gender_map.male will be converted to 1 and female to 0." ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": false }, "outputs": [], "source": [ "gend_mapping = dict(zip(np.sort(df.Sex.unique()), range(len(df.Sex.unique()))))" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedgend_map
0103Braund, Mr. Owen Harrismale2210A/5 211717.2500NaNS1
1211Cumings, Mrs. John Bradley (Florence Briggs Th...female3810PC 1759971.2833C85C0
2313Heikkinen, Miss. Lainafemale2600STON/O2. 31012827.9250NaNS0
3411Futrelle, Mrs. Jacques Heath (Lily May Peel)female351011380353.1000C123S0
4503Allen, Mr. William Henrymale35003734508.0500NaNS1
\n", "
" ], "text/plain": [ " PassengerId Survived Pclass \\\n", "0 1 0 3 \n", "1 2 1 1 \n", "2 3 1 3 \n", "3 4 1 1 \n", "4 5 0 3 \n", "\n", " Name Sex Age SibSp \\\n", "0 Braund, Mr. Owen Harris male 22 1 \n", "1 Cumings, Mrs. John Bradley (Florence Briggs Th... female 38 1 \n", "2 Heikkinen, Miss. Laina female 26 0 \n", "3 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35 1 \n", "4 Allen, Mr. William Henry male 35 0 \n", "\n", " Parch Ticket Fare Cabin Embarked gend_map \n", "0 0 A/5 21171 7.2500 NaN S 1 \n", "1 0 PC 17599 71.2833 C85 C 0 \n", "2 0 STON/O2. 3101282 7.9250 NaN S 0 \n", "3 0 113803 53.1000 C123 S 0 \n", "4 0 373450 8.0500 NaN S 1 " ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['gend_map']= df.Sex.map(gend_mapping).astype(int)\n", "df.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Gender vs Survival Analysis" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": true }, "outputs": [], "source": [ "gend_crosstab = pd.crosstab(df.gend_map , df.Survived)\n", "gend_pct = gend_crosstab.div(gend_crosstab.sum(1).astype(float) , axis=0)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW8AAAELCAYAAAAWWQdYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAE6RJREFUeJzt3X2QXXV9x/H3N9kIhZAKRiwJocvIQ4mQgCQUioUFHV2Q\nh8EKO1FQKFNwTIDOMJXKiF7tWMo4zhQNYFBqnBEIEa0TLJXiw4IjKXYhEiQJJAqdBIjUBglJQ2ST\nb//Ym2Vz9+Euyd3c/WXfr5mdveec3z33e/ee/exvf+cpMhNJUlnGNbsASdKbZ3hLUoEMb0kqkOEt\nSQUyvCWpQIa3JBWobnhHxL9ExG8j4skh2nwlIlZHxBMRcUJjS5Qk1RpOz/ubQPtgCyPibOCIzDwS\nuAK4rUG1SZIGUTe8M/NnwMtDNDkP+Fa17aPAWyPiHY0pT5I0kEaMeU8F1vaZXgcc2oD1SpIG0agd\nllEz7Tn3kjSCWhqwjueBaX2mD63O20lEGOiStAsys7aD3JDwXgLMAxZFxMnA7zPzt4MU0ICXG1kR\nAZVmVzEMPwXOaHYRw1Ap43Mvgdtmg1XK2DYj+uU2MIzwjoi7gdOByRGxFvgcMAEgMxdk5v0RcXZE\nrAE2A5c1rGpJ0oDqhndmzhlGm3mNKUeSNByeYVmq1mYXIA2itdkFjA2Gd6kOb3YB0iDcNvcIw1uS\nCmR4S1KBDG9JKpDhLUkFMrwlqUCGtyQVyPCWpAIZ3pJUIMNbkgpkeEtSgQxvSSqQ4S1JBTK8JalA\nhrckFcjwlqQCGd6SVCDDW5IKZHhLUoEMb0kqkOEtSQUyvCWpQIa3JBXI8JakAhneklQgw1uSCmR4\nS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A537xi1/k7rvvZvz48YwbN44FCxZw0kkn7VaN9913HytWrOC6667brfUATJw4\nkU2bNvWbP9j7Ga6ebXP0/w6VY/c+jz2lut30CybDu4a/II22678gA4Xd0qVLufbaa3nooYeYMGEC\nGzZsYOvWrRxyyCF119fd3U1Ly8gfYHXAAQfw6quv9ptveI82ZYe3wyYqyvr165k8eTITJkwA4KCD\nDuKQQw6htbWVDRs2ANDV1cUZZ5wBQKVS4ZJLLuE973kPH/vYxzjllFNYsWJF7/ra2tp47LHHWLhw\nIVdddRUbN26ktbW1d/nmzZs57LDD2LZtG7/+9a8566yzmDVrFqeddhpPP/00AM8++yynnHIKM2bM\n4DOf+cwe+klorDO8VZT3v//9rF27lqOPPpq5c+fy8MMPA0MPd61atYof//jH3HXXXXR0dLB48WIA\nXnzxRdavX8+JJ57Y23bSpEkcf/zxdHZ2AvCDH/yA9vZ2xo8fzxVXXMFXv/pVurq6+NKXvsQnP/lJ\nAK655hrmzp3L8uXLmTJlygi9c2lnhreKsv/++/PYY49x++238/a3v52Ojg4WLlw4aPuI4LzzzmOf\nffYB4KKLLuLee+8FYPHixVx44YX9ntPR0cE999wDwKJFi+jo6GDTpk088sgjXHjhhZxwwgl84hOf\nYP369QA88sgjzJkzB4CLL764kW9XGpRnWKo448aN4/TTT+f000/nuOOOY+HChbS0tLB9+3YAXnvt\ntZ3a77fffr2Pp0yZwtve9jaefPJJFi9ezIIFC4Cde+7nnnsu119/PS+//DKPP/44Z555Jq+++ioH\nHnggy5Yt2wPvUKrPnreK8swzz7B69ere6WXLltHa2kpraytdXV0AfPe73+1dPtAOqY6ODm666SY2\nbtzIscce26/dxIkTmT17NldffTXnnnsuEcGkSZM4/PDDe3vtmcny5csBOPXUU1m0aBEAd955Z4Pf\nsTQww1tF2bRpE5deeinvete7mDlzJqtWreLzn/88n/vc57jmmmuYPXs2LS0tvT3piOg3Hv7hD3+Y\ne+65h4suuqh3Xm27jo6O3jHyHe68807uuOMOjj/+eI499liWLFkCwM0338wtt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diPijkf9JaSwxvDWqRcRs4EPADOAsYFZ10QLgqsycBfwdcGuf\np/1JZp4KnAP8U3XeBcBRwDHAx4C/YOiedwL/nZknAA8DC6vrOJk3bhOzBbggM08EzgS+3Of5RwG3\nZOZ0YCPwyTf1xqU6PMNSo92pwPcz8w/AHyLiPmBfesL3O31uY/WW6vcEvg9QvXHIO6rzTwPuyp6z\n0l6MiJ8M47WXVL8/CeyfmZuBzRGxNSIm0RPeN0bEXwLbgSkRseOaHmszc2n18beBq9k53KXdYnhr\ntEv6D2+Mo+d2eycM8pw/9Hm847kDraeerdXv22vWuR2YQM9/BJOBd2fmtoh4lp4/LDter28Njq+r\noRw20Wj3c+DciNgnIibSMxTyf8CzEfFh6B3PnlFnPQ8DHRExLiIOAc54EzUMFvqTgJeqwX0G8Kd9\nlh1WvacrwEeAn72J15PqMrw1qmVmFz3DF8uB++kZwvg98FHg8oj4JfAr4Ly+T6t9nJn/CqwGVgDf\nov5V72rXMdD0ncCsiFgOXAL0vbPR08DciFgB/DFwW733Kr0ZXphKo15E7J+ZmyNiP+Ah4G8y85fN\nrmswEdEK3JeZxzW5FO3FHPNWCW6PiOn0jCcvHM3B3Ye9Io0oe94a0yLie8DhNbM/lZkPNqMeabgM\nb0kqkDssJalAhrckFcjwlqQCGd6SVCDDW5IK9P/qW2z2nm5qowAAAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "gend_pct.plot(kind='bar' , stacked = True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Analyze Combined effect of gender and class on Survival output" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[3 1 2]\n", "Males in 1st class : 122\n", "Females in 1st class : 94\n", "Males in 2nd class : 108\n", "Females in 2nd class : 76\n", "Males in 3rd class : 347\n", "Females in 3rd class : 144\n" ] } ], "source": [ "#count number of males and females in each class\n", "uniq_pclass = df.Pclass.unique()\n", "print(uniq_pclass)\n", "print(\"Males in 1st class : \",len(df[(df.Sex == 'male') & (df.Pclass == 1)]))\n", "print(\"Females in 1st class : \",len(df[(df.Sex == 'female') & (df.Pclass == 1)]))\n", "print(\"Males in 2nd class : \",len(df[(df.Sex == 'male') & (df.Pclass == 2)]))\n", "print(\"Females in 2nd class : \",len(df[(df.Sex == 'female') & (df.Pclass == 2)]))\n", "print(\"Males in 3rd class : \",len(df[(df.Sex == 'male') & (df.Pclass == 3)]))\n", "print(\"Females in 3rd class : \",len(df[(df.Sex == 'female') & (df.Pclass == 3)]))\n", "#for p_class in uniq_pclass :\n", " " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Get only Female data" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "collapsed": true }, "outputs": [], "source": [ "#female Survival plot by class\n", "female_df = df[df.Sex == 'female']\n", "\n", "female_df_crtb = pd.crosstab(female_df.Pclass,female_df.Survived)\n", "female_df_crtb = female_df_crtb.div(female_df_crtb.sum(axis=1).astype(float),axis=0)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "###Analyze how female survival rate was affected by Passenger class" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW8AAAEKCAYAAADdBdT9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAE5lJREFUeJzt3X+wXWV97/H315wohJABRBwJsYcp6CWGhJQfVy4ObLTV\nqA0MjnAmLVBpveA1Uf7ondIyKpth0k5qO1M1/ggdahxFQgbwNgjI1B+71oLQgweCQiChMpMAwdog\nIRBoTvjeP87O6WHnnLNPkv0jz+b9mmFmr7WePOu79mI+efKstfaKzESSVJY3dLsASdK+M7wlqUCG\ntyQVyPCWpAIZ3pJUIMNbkgrUNLwj4h8i4tmIeHiSNl+MiI0R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xgJ6PsY\nCXOAv46IExkJ+e9n5vqIuAq4JCJ2Ac8Ay9t2NNIkvGApSQVy2kSSCmR4S1KBDG9JKpDhLUkFMrwl\nqUCGtyQVyPCWpAIZ3pJUoP8PsB5cZ8s+5xUAAAAASUVORK5CYII=\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "female_df_crtb.plot(kind='bar', stacked=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "So Majority of First class and Second class passenger females were saved, while comparatively fewer number of\n", "females from 3rd class were saved. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "###Analyze how male survival rate was affected by Passenger class" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Select only Male data and plot" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "collapsed": true }, "outputs": [], "source": [ "male_df = df[df.Sex == 'male']\n", "male_df_crtb=pd.crosstab(male_df.Pclass,male_df.Survived)\n", "male_df_crtb=male_df_crtb.div(male_df_crtb.sum(axis=1).astype(float), axis=0)" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW8AAAEKCAYAAADdBdT9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAE6NJREFUeJzt3X+MXWWdx/H3104VsDRQK8YW3CGCLrW0VH4sRAMXcXVU\nCmEjTLryQ9hdcG2VP3YjK9FlDOmarjHxR/1RFK2JSGlAd0FQsv646koFBwaKQKFVSVqgqFukFAE7\n5bt/zO04TGfmTjt37r3P9P1KmtxzzjPn+Z45088885xz7o3MRJJUlpe1ugBJ0t4zvCWpQIa3JBXI\n8JakAhneklQgw1uSClQ3vCPiaxHxZETcP0abz0XExoi4LyIWNbZESdJw4xl5fx3oGm1jRLwbOCoz\njwYuBb7UoNokSaOoG96Z+TPgqT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+MiKMZCPkfZOb6iLgCuCAidgJPAMsn7WikMXjBUpIK5LSJJBXI8JakAhne\nklQgw1uSCmR4S1KBDG9JKpDhLUkFMrwlqUD/D4jQGE+eFhDMAAAAAElFTkSuQmCC\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "male_df_crtb.plot(kind='bar' , stacked=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "###Handling Null values" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Let us see how many null values Embarked column has" ] }, { "cell_type": "code", "execution_count": 22, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedgend_map
616211Icard, Miss. Ameliefemale380011357280B28NaN0
82983011Stone, Mrs. George Nelson (Martha Evelyn)female620011357280B28NaN0
\n", "
" ], "text/plain": [ " PassengerId Survived Pclass Name \\\n", "61 62 1 1 Icard, Miss. Amelie \n", "829 830 1 1 Stone, Mrs. George Nelson (Martha Evelyn) \n", "\n", " Sex Age SibSp Parch Ticket Fare Cabin Embarked gend_map \n", "61 female 38 0 0 113572 80 B28 NaN 0 \n", "829 female 62 0 0 113572 80 B28 NaN 0 " ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df[df.Embarked.isnull()]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "###Encode Categorical variable embarked to numerical values instead of text values" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "{'C': 0, 'Q': 1, 'S': 2, 'nan': 3}" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Encode Embarked column\n", "embark_uniq = np.sort(df.Embarked.astype(str).unique())\n", "embark_enc = dict(zip(embark_uniq,range(len(embark_uniq))))\n", "embark_enc" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Create new Encoded column Embarked_map " ] }, { "cell_type": "code", "execution_count": 24, "metadata": { "collapsed": false }, "outputs": [], "source": [ "df['Embarked_map'] = df.Embarked.map(embark_enc)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### From where most of people started their Journey? " ] }, { "cell_type": "code", "execution_count": 25, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEACAYAAAC9Gb03AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAF5ZJREFUeJzt3W+MXFd9xvHvkzgWJIRsolRrO0m1rhQTLKVaoDFVAXVI\n7ShFxckL5DgS1ItaVDXij1S1ik1buW9q3LwpaqtKVSHsqm1cBagsh5JgB3wRqMUu4IWQjWtbYqWY\n1gtRSBRIBY7y64u5TobJ9e7M+J69e88+H2mVe+/cmfmdnOPfzj57Z1YRgZmZ5euypgswM7O03OjN\nzDLnRm9mljk3ejOzzLnRm5llzo3ezCxzSzZ6SW+SdKLn63lJH5V0naQjkk5JOixprOc+eySdlnRS\n0h1ph2BmZovRMNfRS7oM+AGwBfgI8ExEPCDpfuDaiNgtaTPwEHAbcAPwOLApIl6uvXozM1vSsNHN\nVuBMRDwNbAdmyuMzwN3l9l3AgYg4HxHzwBm63xjMzKwBwzb6ncCBcns8IhbK7QVgvNzeAJztuc9Z\nuq/szcysAQM3eklrgfcCn+2/Lbr5z2IZkD9nwcysIWuGOPe3gW9FxI/K/QVJ6yLinKT1wA/L4z8A\nbuq5343ls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040XfaUPOXLLqJi7xxStIflLf/Q0R8UdJ7JJ0Bfgp8MFU9dRtkfMD7\ngD+U9BLwIrCzsYKHJOkA8JvA9ZKeBvbSvbqo9XMHS4+PFs8d8A7g/cB3JV1oEB8HfhmymL8lx0e7\n5289MCPpMrovxv8pIr58Kb3Tb5gyM8uc/5SgmVnm3OjNzDLnRm9mljk3ejOzzLnRm5llzo3ezCxz\nbvRmZplzozczy9z/AzZaRp9Y7orzAAAAAElFTkSuQmCC\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df.Embarked_map.hist(bins=len(embark_uniq),range=(0,3))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Replace null values with most frequent ouccurence" ] }, { "cell_type": "code", "execution_count": 26, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "61 NaN\n", "829 NaN\n", "Name: Embarked_map, dtype: float64" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.Embarked_map[df.Embarked_map.isnull()]" ] }, { "cell_type": "code", "execution_count": 27, "metadata": { "collapsed": false }, "outputs": [], "source": [ "df.Embarked_map.fillna(2,inplace=True)" ] }, { "cell_type": "code", "execution_count": 28, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "Series([], Name: Embarked_map, dtype: float64)" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.Embarked_map[df.Embarked_map.isnull()]" ] }, { "cell_type": "code", "execution_count": 29, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "61 NaN\n", "829 NaN\n", "Name: Embarked, dtype: object" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.Embarked[df.Embarked.isnull()]" ] }, { "cell_type": "code", "execution_count": 30, "metadata": { "collapsed": true }, "outputs": [], "source": [ "df.Embarked.fillna('S',inplace=True)" ] }, { "cell_type": "code", "execution_count": 31, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "Series([], Name: Embarked, dtype: object)" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.Embarked[df.Embarked.isnull()]" ] }, { "cell_type": "code", "execution_count": 32, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "array(['S', 'C', 'Q'], dtype=object)" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.Embarked.unique()" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "##Analysing Age" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Age is an Ordinal variable. It also has some missing values. there can be many strategies to fill missing values. \n", "1. Replace missing value with max occurence (we did this in Embarked case.)\n", "2. Replace missing value with mean value.\n", "\n", "Here we will replace missing vaules in Age with mean value. One more interesting thing we can try is, replacing missing value with values in similar record. Let us assume we will replace age with mean of age in same Passenger Class and gender. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let us see rows with missing Age value, with additional value of Pclass and gender " ] }, { "cell_type": "code", "execution_count": 33, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "(177, 3)" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "age_null = df[df.Age.isnull()][ ['Pclass','Sex' , 'Age']]\n", "age_null.shape" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "There are 177 records with null values for Age.\n", "\n", "Let us create a new column 'Age_enc' , which will not have any null values replaced with mean(But mean can have decimal value, so lets use Median) in respective \n", "Pclass and Gender." ] }, { "cell_type": "code", "execution_count": 34, "metadata": { "collapsed": false }, "outputs": [], "source": [ "df['Age_enc'] = df['Age']\n", "df.Age_enc = df.Age_enc.groupby([df.gend_map , df.Pclass]).apply(lambda x: x.fillna(x.median()))\n", "\n" ] }, { "cell_type": "code", "execution_count": 35, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df[df.Age_enc.isnull()])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "###Age vs Survival Column\n", "Let us do Cross tab analysis of Age variable with Survival column\n" ] }, { "cell_type": "code", "execution_count": 36, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEbCAYAAAAlAxTiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXm4HVWVt99FEkAIIYQhQAAvIiAIhFFB0FwU6WAbEBki\n3SCDY4OAtv0p2AonditT+ykfaisNCNJMEQSJKBAxFxUQDAQSEkIgJECISSABMpDxZn9/rH1y61bu\nmad76/7e5znPqXX2UGvvWrVq1a5d+1gIASGEENlgk1YrIIQQon7IqQshRIaQUxdCiAwhpy6EEBlC\nTl0IITKEnLoQQmSIok7dzG4ws4VmNi3x21Vm9pyZPWNmvzazrRNpF5vZC2Y208yObaTiQgghNqZU\npP4LYHTqtweB94cQRgKzgIsBzGxfYCywbyzzUzPTnYAQQjSRok43hPBn4M3UbxNDCOuj+DiwS9w+\nAbgthLA2hDAXeBH4QH3VFUIIUYxaI+lzgN/F7Z2BeYm0ecCIGusXQghRAVU7dTP7d2BNCOHWItm0\nBoEQQjSRgdUUMrOzgE8AH0v8/Bqwa0LeJf6WLitHL4QQVRBCsFJ5Ko7UzWw08H+AE0IIqxJJ9wKf\nMbNNzWx3YE/giQKKcemllxJC2PCpRO6LZXuLHn2xbG/Roy+W7S169MWyvUWP/Ha5FI3Uzew2YBSw\nnZm9ClyKz3bZFJhoZgCPhRDODSHMMLPxwAxgHXBuqEQTIYQQNVPUqYcQTuvh5xuK5P8+8P1alRJC\nCFEdA3K5XFN3OG7cuFx+n21tbd3SKpH7YtneokdfLNtb9OiLZXuLHn2xbG/Ro62tjXHjxpHL5cZR\nAmv2CImZaVSmnxOH7QAqGisUoj9jZoQyHpRWNftFiJrJxY8QNZIMErJCLcGOnLoQos+TpTu+Wi9S\nWptFCCEyhJy6EEJkCDl1IYTIEHLqQohM8r3vfY/99tuPkSNHctBBB/HEEz2+4F4REyZM4IorrqiD\ndjB48OC61JNGD0qFEJnjscce47777mPKlCkMGjSIJUuWsHr16rLKrlu3joEDe3aNY8aMYcyYMXXR\nsVGzdhSpCyEyx4IFC9huu+0YNGgQAMOGDWOnnXaira2NJUuWADB58mSOPvpoAHK5HGeccQZHHXUU\nn/3sZzniiCOYMWPGhvra29t58sknufHGGzn//PNZunRpt5eDVqxYwW677UZnZyezZ8/muOOO49BD\nD+UjH/kIzz//PABz5szhiCOO4IADDuDb3/52w9oupy6EyBzHHnssr776KnvvvTfnnXcef/rTn4Di\n0fHMmTN56KGHuPXWWxk7dizjx48H4O9//zsLFizgkEMO2ZB3yJAhHHjggXR0dADw29/+ltGjRzNg\nwAC++MUvcs011zB58mSuuuoqzj33XAAuvPBCzjvvPKZOncrOO+/coJbLqQshMsiWW27Jk08+ybXX\nXsv222/P2LFjufHGGwvmNzOOP/54NttsMwBOPfVU7rzzTgDGjx/PKaecslGZsWPHcscddwBw++23\nM3bsWJYvX86jjz7KKaecwkEHHcSXv/xlFixYAMCjjz7Kaaf5clqnn356PZvbDY2pCyEyySabbMKo\nUaMYNWoU+++/PzfeeCMDBw5k/Xr/N85Vq1Z1y7/FFlts2N55553ZdtttmTZtGuPHj+fnP/850D3S\nHzNmDN/61rd48803eeqpp/joRz/KsmXL2GabbZgyZUoTWtgzitSFEJlj1qxZvPDCCxvkKVOm0NbW\nRltbG5MnTwbgrrvu2pDe0xupY8eO5YorrmDp0qXst99+G+UbPHgwhx12GBdccAFjxozBzBgyZAi7\n7777hig/hMDUqVMBOPLII7n99tsBuOWWW+rc4i7k1IUQmWP58uWcddZZvP/972fkyJHMnDmTcePG\ncemll3LhhRdy2GGHMXDgwA2Rt5ltNN5+8sknc8cdd3Dqqadu+C2db+zYsRvG4PPccsstXH/99Rx4\n4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um5/tdmjc3hoPHHqS9yySVkg+IS/H/e2d6pNSchvd\nZ92NBUZW4p9asvSuEKI0ZvZJ4EMhhG+Vk15MLpW3WN2V7Kd+rRfVIqcuhBAZovzBdyGEEL0eOXUh\nhMgQcupCCJEh5NSFECJDyKmLPo+ZfcrM1pvZ3q3WRYhWI6cussBp+P/gntZqRYRoNXLqok9jZoPx\nv4/7Cv6iBma2iZn91MyeM7MHzew+Mzspph1iZh1mNtnM7jezHYvUvYeZ/T7m/VP+TsDMbjSzq83s\nETObna87pn3TzKaa2dNmdllDGy9EDzRj7RchGskJwP0hhFfM7HUzOxj/W8B3hxD2MbPh+OvW15vZ\nIHzJ1TEhhMVmNhZfNvVzBeq+Fl/T/0Uz+yD+Kv3HYtqOIYQj4zLB9wJ3mdlx+LodHwghrDKzbRrV\naCEKIacu+jqn4Wtag7+yfhpu1+MBgv+B8qSYvje+RvYf4kJnA/BX4Tci3gEcAfwqsShafr3/gC+G\nRQjhuXjhAF+g6YYQwqqY9mYd2idERcipiz5LXIXvaGC/uMLhANzh3k3Xyn1ppocQPlRG9ZsAb4UQ\nDiqQviapSvwORfYrRFPQmLroy5yM/zlDWwhh9xDCbvjqeEuAk8wZDrTH/M8D25vZ4QBmNsjM9u2p\n4hDCUmCOmZ0c85qZHVBCn4nA2Wb2rlhGwy+i6cipi77MZ/CoPMld+Ip58/B/DroZX8L27eB/B3Yy\ncIWZ5f8V/ogi9f8z8LmY91l8vDxPSG+HEB7Ax9cnm9kU/P9AhWgqWtBLZBIz2zKEsCL+acLj+CqC\ni1qtlxCNRmPqIqv81syG4g83vyuHLvoLitRFv8fMfgwcmfr5RyGEm1qhjxC1IKcuhBAZQg9KhRAi\nQ8ipCyFEhpBTF0KIDCGnLoQQGeL/A0fmsOHNB2qtAAAAAElFTkSuQmCC\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "age_crstb = pd.crosstab(df.Age_enc,df.Survived)\n", "age_crstb.plot(kind='bar' , stacked=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Looks Like we have to bin the data" ] }, { "cell_type": "code", "execution_count": 37, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "80.0\n" ] }, { "data": { "text/plain": [ "array([[,\n", " ]], dtype=object)" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAEKCAYAAAAPVd6lAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHPRJREFUeJzt3X+wXPV93vH3gySMriT0ozgSjanBbWWoJ42AGpwagoQF\nBU9M6T+umdqVqeOZTuMf1GNHIhmHTj2OicadKJ02U9cxVHFcjONgCglNEPgeRmlaMKCVZASR3XCn\nEKPLD3GRZeQWzKd/nHPR5Vqru3vO2d3v2fO8Zna059w9j766+uqrvc+ePauIwMzMmuuUUQ/AzMyq\n8UJuZtZwXsjNzBrOC7mZWcN5ITczazgv5GZmDeeF3Mys4byQj4ikNZK+JemopClJ1416TGaDIulj\nkh6W9GNJt456PONm8agH0GL/Efgx8DPA+cCfSNobEQdGOyyzgfhr4HPAPwKWjngsY0d+Z+fwSVoG\nHAbeERHfL/btBH4QETeOdHBmAyTpc8BbIuL6UY9lnLhaGY31wKuzi3hhL/COEY3HbFg06gGMIy/k\no7EcODJv3w+BFSMYi9kwuQIYAC/ko3EUOH3evpXki7nZOPMz8gHwQj4aB4HFkv7OnH0/D3x3ROMx\nGxY/Ix8AL+QjEBE/Au4A/q2kCUmXAO8DvjrakZkNhqRFkk4jP1NukaQ3SVo06nGNCy/ko/OvyE/D\nehb4A+BfRsTjox2S2cB8FngZ2Ap8EDgG/PpIRzRGFjz9UNLbga/P2fU28r+UPwBuB94KTAHvj4iZ\nwQzTbLgkrQJ+j/xMogCuB76H57wlqK/zyCWdQn5i/0XAx4HnI2K7pK3A6ojYNphhmg1XcV7/AxFx\ni6TFwDLyZ5Ce85acfh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1cCv\nSLq0RM5i4ALgdyPiAuBH5M8ky4wHAEmnAu8D/nD+13r8Hv1t4AbyZ6d/E1gu6YNVxjQknvMnHkdq\ncx5qnvepzPlBLOR/Td4VzTqL/BlKFdOS1gFIOhN4tpeDJC0hn9BfjYg7q2QBRMRLwJ8AF5bI+YfA\nNZKeJP/f+3JJXy0znoh4pvj1OeBb5NcA6TfnaeDpiPhOsf1N8gl+qOz3h/wf2SPFuCgxpn8A/EVE\nvBARrwJ3kNcWVcY0DJ7zJ5banIf6530Sc34QC/nDwN+VdHbxv9U/Be6qmHkX+QsAFL/eeZLHAiBJ\nwFeAAxGxo2yWpDNmXzGWtJS8v9rTb05E/FpEnBUR55D/KPbtiPhQifFMSFpR3F9G3s/tLzGeQ8BT\nktYXuzYDj5F3dH19r+e4juM/YtLvmMh7wXdJWlr8/W0GDlQc0zB4zp9AanO+GFPd8z6NOd9rod/P\njfx/qb8kfyX/xj6PvY28K/p/5L3j9eQvCNwHHATuBVb1kHMJeS/XIZ+Ee8gvP9pXFvBzwKNFzj7g\nM3H8RYq+xjQn8zKOv4Lf73jOKcbSAb47+/0t+T36efIXsvaSPxNYWfbPBSwDngdWzNlXZky/Sv4P\naz/52QVLqnyvh3XznG/GnK9z3qc05/2GIDOzhvOHL5uZNZwXcjOzhvNCbmbWcF7Izcwazgu5mVnD\neSE3M2s4L+RmZg3nhdzMrOH+P3p5Lx5NTDvbAAAAAElFTkSuQmCC\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "#bins= (df.Age_enc.max()/len(df.Age_enc))\n", "print(df.Age_enc.max())\n", "age_crstb.hist(bins= (df.Age_enc.max()/10),range=(1, df.Age_enc.max()) , stacked = True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The plot above does not give any clear picture. Let us create a density distribution by class" ] }, { "cell_type": "code", "execution_count": 38, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute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I\nmidNT7QzCYwD1Xm3zUpvtzXTv4nnhO3W3PYksGH7g03+VJMVCUVXQ0h6EvgEeMP2/epiRdtuer2O\npDPAmu3rkp7vdE4JnqT+Pkza7+0bSVPAW9UTSvCU9DTwJmmqZB34SNJr1XNK8OxEDa/GnR93PCo2\naNh+sVO7pCOkO6aFPHgMAN8qbXj4GynX0WIgt+24ZwtJF0nTFi9Umnfc8z9o9xnk33cejSGphxQw\npm3P5uZVSU/ZXpF0EFhrzhCAk8BZpQ049wL7JU1Tnucy6RN668u/PybdgK0U5nkc+Nr27wCSZoBn\nKc+zRbf3ubR+viXj0a6bnrL9k+1+20O2h0gdYTh/PJwDzkvqlTQEHAauNeWqtL37GHDO9oPKoaI8\nqSzElNRLWkw516APAEp3Be8Ci7anKofmSIlR8s/Z9tfuJLYnbA/m6/E88KXtC5TnuQL8KumZ3DQC\n3AA+pSBPYAk4IWlfvgZGgEXK82zR7X0uqp9v2Xi0E5n8ba4SuE2unsrPJ0iJnCXgpYbdfgbuANfz\n43KJntnnFVJ10i1gvGmf7HSKlCP4vvI/fJm0idEXwE3gc+BA064V59M8qp4qzhM4SvqqgQVghlQ9\nVaLnJVJA+5GUXO4pwRP4kJRn2SDlAV/fzKupft7Bc3SrxqNY3BcEQRDUZtdNTwVBEATNEUEjCIIg\nqE0EjSAIgqA2ETSCIAiC2kTQCIIgCGoTQSMIgiCoTQSNIAiCoDYRNIIgCILaPATUlpkS3TWF5QAA\nAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "p_classes = df.Pclass.unique()\n", "\n", "for cl in p_classes :\n", " df.Age_enc[df.Pclass == cl].plot(kind='kde')\n", " \n", "plt.legend(('1st Class', '2nd Class', '3rd Class'), loc='best')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It looks like First class people were generally older than second class and so was the case with second class with \n", "third class." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Creating new Features" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Data science generally also involves creating new features by combing multiple already existing features. Let us \n", "find out how can we do this in this context\n", "\n", "Let us combine 'parch' and 'Sibsp' coulmn and create a new column Family size 'FamilySz'" ] }, { "cell_type": "code", "execution_count": 39, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarkedgend_mapEmbarked_mapAge_encFamilySz
0103Braund, Mr. Owen Harrismale2210A/5 211717.2500NaNS12221
1211Cumings, Mrs. John Bradley (Florence Briggs Th...female3810PC 1759971.2833C85C00381
2313Heikkinen, Miss. Lainafemale2600STON/O2. 31012827.9250NaNS02260
3411Futrelle, Mrs. Jacques Heath (Lily May Peel)female351011380353.1000C123S02351
4503Allen, Mr. William Henrymale35003734508.0500NaNS12350
\n", "
" ], "text/plain": [ " PassengerId Survived Pclass \\\n", "0 1 0 3 \n", "1 2 1 1 \n", "2 3 1 3 \n", "3 4 1 1 \n", "4 5 0 3 \n", "\n", " Name Sex Age SibSp \\\n", "0 Braund, Mr. Owen Harris male 22 1 \n", "1 Cumings, Mrs. John Bradley (Florence Briggs Th... female 38 1 \n", "2 Heikkinen, Miss. Laina female 26 0 \n", "3 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35 1 \n", "4 Allen, Mr. William Henry male 35 0 \n", "\n", " Parch Ticket Fare Cabin Embarked gend_map Embarked_map \\\n", "0 0 A/5 21171 7.2500 NaN S 1 2 \n", "1 0 PC 17599 71.2833 C85 C 0 0 \n", "2 0 STON/O2. 3101282 7.9250 NaN S 0 2 \n", "3 0 113803 53.1000 C123 S 0 2 \n", "4 0 373450 8.0500 NaN S 1 2 \n", "\n", " Age_enc FamilySz \n", "0 22 1 \n", "1 38 1 \n", "2 26 0 \n", "3 35 1 \n", "4 35 0 " ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['FamilySz'] = df.Parch + df.SibSp\n", "df.head(5)" ] }, { "cell_type": "code", "execution_count": 40, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAAEBCAYAAACKUEVYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEb1JREFUeJzt3WuMnFd9x/HvLzYRt4KJAo7tuCVScMFqKVDiogLqpE0j\ng6iTVyGRiqKQ8ibiIqQibKQ2RpVCiFpR1CpvColcSlxZXKJEbcFOyLSgSgkBh0sckwSxUjbFm3AV\nt4q4+ffFPLEnznp37J3Z2T35fqRVzpznzJz/rje/OXPm2WdSVUiSVrczpl2AJGnpDHNJaoBhLkkN\nMMwlqQGGuSQ1wDCXpAaMFOZJ1iX5TJIHkhxK8gdJzkpyIMmDSfYnWTc0fleSh5IcTnLx5MqXJMHo\nK/OPA/9eVa8CXg0cBnYCB6pqC3Bnd5skW4G3A1uB7cCNSXwFIEkTtGjIJnkx8Oaqugmgqo5W1U+B\nHcCeb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9ZakruBC6vql0nO6H7hn1pdfWl4pbfMdc1w/K81CnhjVX0/yW8AX66q10yhpjXA\n+4C3Ah+oqoNJvldV5y13LUM1rWOwvfJm4HEG++WzDP4/fE9VfWMKNT1YVVtO9diEazrpK98kL6iq\nX8x3bGzzr5Ywh2O/6NsYrNALeBS4t1v1TaOem4Cbq+rL8xzbW1VXTKGmzcATVXXkhP4wCKuvTKGm\n51bV/87TfzawoaoWeoWz7Lo3+dZX1femWMO5wMcYbB3smMaW3YmSvBg4j8Er+tkTf8eWuZYDwAFg\nT1XNdX3nMFiZ/2lVXTSFmn67qr6z3PMem381hbn0bJPkbcAfVtWHpl3LStJtj+0EdjDYM4fB+zG3\nMdgz/9G0apsWw1xSU5JcVVXPurNsDHNJTZnWmWTTtprOZpEkYNEzydYvcKxZhrmk1ehlLHAm2TLX\nsiIY5pJWo38DXlhVB088kOQ/p1DP1LlnLkkNWDXXZpEknZxhLkkNMMwlqQGGuSQ1wDCXpAb8PwxW\npJFaIVH+AAAAAElFTkSuQmCC\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df.FamilySz.value_counts().plot(kind='bar')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "###Plot Family Size vs Survival" ] }, { "cell_type": "code", "execution_count": 41, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAAEQCAYAAABC2pRmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGQFJREFUeJzt3X+QldWd5/H3R1qDggQJijTqNDuKkRARFTauJl5dQ+Ek\nomYirbsx+GOSSumoNZukglYibaX8gdmpGcvETTJRYSeIdmm0ILsbQZKbxDElAVsxtAi4smWr3TjB\nUcEfQ8N3/7gPzaVpum/T9/bte/i8qrp87nnOfZ5zafh47nnO8xxFBGZmVtsOqXYDzMxs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": [ "fmly_crstb = pd.crosstab(df.FamilySz , df.Survived)\n", "fmly_crstb.plot(kind = 'bar' , stacked = True)" ] }, { "cell_type": "code", "execution_count": 42, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Survived01
FamilySz
00.6964620.303538
10.4472050.552795
20.4215690.578431
30.2758620.724138
40.8000000.200000
50.8636360.136364
60.6666670.333333
71.0000000.000000
101.0000000.000000
\n", "
" ], "text/plain": [ "Survived 0 1\n", "FamilySz \n", "0 0.696462 0.303538\n", "1 0.447205 0.552795\n", "2 0.421569 0.578431\n", "3 0.275862 0.724138\n", "4 0.800000 0.200000\n", "5 0.863636 0.136364\n", "6 0.666667 0.333333\n", "7 1.000000 0.000000\n", "10 1.000000 0.000000" ] }, "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fmly_crstb.div(fmly_crstb.sum(axis=1),axis=0)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "These does not give any clear picture. Let us try executing machine learning algo on this data." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Apply Machine Learning on data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Dropping unnecessery columns" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We are not going to use 'Name', 'Sex', 'Ticket', 'Cabin', 'Embarked', 'Age', 'SibSp', 'Parch', 'PassengerId'. \n", "So let us drop these columns." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "let us put all of our cleaning work in a function. So that we can use it with test data also." ] }, { "cell_type": "code", "execution_count": 43, "metadata": { "collapsed": false }, "outputs": [], "source": [ "def clean_data(df):\n", " #Encoding Gender Column\n", " gend_mapping = dict(zip(np.sort(df.Sex.unique()), range(len(df.Sex.unique()))))\n", " df['gend_map']= df.Sex.map(gend_mapping).astype(int)\n", " \n", " #Encode Embarked column\n", " df.Embarked.fillna('S',inplace=True)\n", " embark_uniq = np.sort(df.Embarked.astype(str).unique())\n", " embark_enc = dict(zip(embark_uniq,range(len(embark_uniq))))\n", " df['Embarked_map'] = df.Embarked.map(embark_enc)\n", " \n", " # Fill in missing values of Fare with the average Fare\n", " if len(df[df.Fare.isnull()] > 0):\n", " avg_fare = df.Fare.mean()\n", " df.replace({ None: avg_fare }, inplace=True)\n", "\n", " #Encode Age\n", " df['Age_enc'] = df.Age\n", " df.Age_enc = df.Age_enc.groupby([df.gend_map , df.Pclass]).apply(lambda x: x.fillna(x.median()))\n", " \n", " #Create Family size column\n", " df['FamilySz'] = df.Parch + df.SibSp\n", " \n", " # Drop the columns we won't use:\n", " df = df.drop(['Name', 'Sex', 'Ticket', 'Cabin', 'Embarked','Age', 'SibSp', 'Parch', 'PassengerId' ], axis=1)\n", " \n", " return df\n", " " ] }, { "cell_type": "code", "execution_count": 44, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
SurvivedPclassFaregend_mapEmbarked_mapAge_encFamilySz
0037.250012221
11171.283300381
2137.925002260
31153.100002351
4038.050012350
\n", "
" ], "text/plain": [ " Survived Pclass Fare gend_map Embarked_map Age_enc FamilySz\n", "0 0 3 7.2500 1 2 22 1\n", "1 1 1 71.2833 0 0 38 1\n", "2 1 3 7.9250 0 2 26 0\n", "3 1 1 53.1000 0 2 35 1\n", "4 0 3 8.0500 1 2 35 0" ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "train = clean_data(df)\n", "train.head(5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create a RandomForestClassifier " ] }, { "cell_type": "code", "execution_count": 45, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from sklearn.ensemble import RandomForestClassifier\n", "clf = RandomForestClassifier(n_estimators=100)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "Training the classifier\n" ] }, { "cell_type": "code", "execution_count": 46, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "RandomForestClassifier(bootstrap=True, class_weight=None, criterion='gini',\n", " max_depth=None, max_features='auto', max_leaf_nodes=None,\n", " min_samples_leaf=1, min_samples_split=2,\n", " min_weight_fraction_leaf=0.0, n_estimators=100, n_jobs=1,\n", " oob_score=False, random_state=None, verbose=0,\n", " warm_start=False)" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "y = train.Survived\n", "train = train.drop(['Survived'] , axis=1)\n", "clf.fit(train , y)" ] }, { "cell_type": "code", "execution_count": 47, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "0.98092031425364756" ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "clf.score(train,y)" ] }, { "cell_type": "code", "execution_count": 48, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PclassFaregend_mapEmbarked_mapAge_encFamilySz
037.82921134.50
137.00000247.01
229.68751162.00
338.66251227.00
4312.28750222.02
\n", "
" ], "text/plain": [ " Pclass Fare gend_map Embarked_map Age_enc FamilySz\n", "0 3 7.8292 1 1 34.5 0\n", "1 3 7.0000 0 2 47.0 1\n", "2 2 9.6875 1 1 62.0 0\n", "3 3 8.6625 1 2 27.0 0\n", "4 3 12.2875 0 2 22.0 2" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "test = clean_data(test)\n", "test.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "Trying Cross Validation with SKLearn\n" ] }, { "cell_type": "code", "execution_count": 49, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(891, 6) (891,)\n", "(712, 6) (712,)\n", "(179, 6) (179,)\n" ] } ], "source": [ "from sklearn import metrics\n", "from sklearn.cross_validation import train_test_split\n", "\n", "# Split 80-20 train vs test data\n", "train_x, test_x, train_y, test_y = train_test_split(train, \n", " y, \n", " test_size=0.20, \n", " random_state=0)\n", "print (train.shape, y.shape)\n", "print (train_x.shape, train_y.shape)\n", "print (test_x.shape, test_y.shape)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "##Creating Classification report\n" ] }, { "cell_type": "code", "execution_count": 50, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " precision recall f1-score support\n", "\n", " 0 0.99 0.98 0.99 110\n", " 1 0.97 0.99 0.98 69\n", "\n", "avg / total 0.98 0.98 0.98 179\n", "\n" ] } ], "source": [ "from sklearn.metrics import classification_report\n", "print(classification_report(test_y,clf.predict(test_x)))" ] } ], "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.4.3" } }, "nbformat": 4, "nbformat_minor": 0 }