From 8de44b5f03a4b0740eb1852a03ff01bb74ebaf2b Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 24 Aug 2018 14:53:59 +0530 Subject: [PATCH 01/39] Add files via upload --- Titanic-DataQuest.ipynb | 2631 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 2631 insertions(+) create mode 100644 Titanic-DataQuest.ipynb diff --git a/Titanic-DataQuest.ipynb b/Titanic-DataQuest.ipynb new file mode 100644 index 0000000..9063416 --- /dev/null +++ b/Titanic-DataQuest.ipynb @@ -0,0 +1,2631 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "from sklearn.ensemble import RandomForestClassifier\n", + "from sklearn.cross_validation import train_test_split\n", + "from sklearn.externals import joblib\n", + "from sklearn.naive_bayes import GaussianNB\n", + "from sklearn.linear_model import LogisticRegression\n", + "import numpy as np\n", + "from sklearn.metrics import accuracy_score\n", + "from sklearn.model_selection import cross_val_score" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [], + "source": [ + "#Loading the complete File" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [], + "source": [ + "titanicCompleteData= pd.read_csv(\"C:/MyFolder/titanic.csv\")" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [], + "source": [ + "#In the file we have total 1310 records. From these records we have decided to keep 891 for training purpose." + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [], + "source": [ + "trainData = titanicCompleteData.head(891)" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimensions of train: (891, 14)\n" + ] + } + ], + "source": [ + "print(\"Dimensions of train: {}\".format(trainData.shape))\n" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [], + "source": [ + "#The reamining 418 records will be used for testing purpose." + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [], + "source": [ + "untouchedTestData = titanicCompleteData.tail(418)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [], + "source": [ + "#From the test records, we are deleting the 'survived' columns.\n", + "#ONE THING IMPORTANT IS THAT WE ARE NOT DELETING FROM THE ACTUAL FILE BUT FROM THE DATAFRAME.\n", + "#ANOTHER IMPORTANT THING IS THAT- HERE WE HAVE ONE FILE WHICH WE HAVE DIVIDED INTO TWO DATAFRAMES.\n", + "#IF WE WERE GIVEN TWO FILES (TEST & TRAIN) WE COULD HAVE SIMPLY LOADED BOTH OF THEM INTO TWO DIFFERENT DATAFRAMES.\n", + "#ONE FILE | TWO FILE APPROACH MAKES NO DIFFERENCE ! " + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [], + "source": [ + "del untouchedTestData['survived']" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimensions of test: (418, 13)\n" + ] + } + ], + "source": [ + "print(\"Dimensions of test: {}\".format(untouchedTestData.shape))" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [], + "source": [ + "#Pandas has a method called 'cut'. The method is used for segmenting into categories.\n", + "#We are planning to introduce a new column 'Age Categories' in the Training set.\n", + "#We will be using 'cut' method to segment the ages into defined categories.\n", + "#EXAMPLE:\n", + "#-1 - 0 = Missing\n", + "#0 - 5 = Infant\n", + "#5 - 12 = Child\n", + "#12 - 18 = Teenager\n", + "#18 - 35 = Young Adult\n", + "#35 - 60 = Adult\n", + "#60 - 100 = Senior" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [], + "source": [ + "def process_age(df,cut_points,label_names):\n", + " df[\"age\"] = df[\"age\"].fillna(-0.5)\n", + " df[\"Age_categories\"] = pd.cut(df[\"age\"],cut_points,labels=label_names)\n", + " return df\n" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:2: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", + " \n", + "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:3: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", + " This is separate from the ipykernel package so we can avoid doing imports until\n" + ] + } + ], + "source": [ + "cut_points = [-1,0,5,12,18,35,60,100]\n", + "label_names = [\"Missing\",\"Infant\",\"Child\",\"Teenager\",\"Young Adult\",\"Adult\",\"Senior\"]\n", + "\n", + "trainData = process_age(trainData,cut_points,label_names)\n", + "untouchedTestData = process_age(untouchedTestData,cut_points,label_names)" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [], + "source": [ + "#Notice that after the addition of new column 'Age Categories' the dimention changed from (891,14) ---> (891,15)\n", + "#AND (891,13) ---> (418,14)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimensions of train: (891, 15)\n" + ] + } + ], + "source": [ + "print(\"Dimensions of train: {}\".format(trainData.shape))" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimensions of train: (418, 14)\n" + ] + } + ], + "source": [ + "print(\"Dimensions of train: {}\".format(untouchedTestData.shape))" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [], + "source": [ + "# Right now our Training Dataframe is of (891,15) dimention.\n", + "# and our Testing Dataframe is of (418, 14) dimention.\n", + "\n", + "#Now, we are going introducing 7+3 columns (in both Training and Testing Dataframes)\n", + "#7 new columns will be for ages. Default values = 0 \n", + "#3 new columns will be for class.Default values = 0 " + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:4: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", + " after removing the cwd from sys.path.\n", + "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:7: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", + " import sys\n", + "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:12: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", + " if sys.path[0] == '':\n", + "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:15: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", + " from ipykernel import kernelapp as app\n" + ] + } + ], + "source": [ + "new_age_columns = [\"Missing\",\"Infant\",\"Child\",\"Teenager\",\"Young Adult\",\"Adult\",\"Senior\"]\n", + "\n", + "for newCol in new_age_columns:\n", + " trainData[newCol] =0\n", + " \n", + "for newCol in new_age_columns:\n", + " untouchedTestData[newCol] =0\n", + " \n", + " \n", + "new_class_columns = [\"PClass1\", \"PClass2\", \"PClass3\"]\n", + "for newCCol in new_class_columns:\n", + " trainData[newCCol] =0\n", + " \n", + "for newCCol in new_class_columns:\n", + " untouchedTestData[newCCol] =0" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimensions of train: (891, 25)\n" + ] + } + ], + "source": [ + "print(\"Dimensions of train: {}\".format(trainData.shape))" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimensions of train: (418, 24)\n" + ] + } + ], + "source": [ + "print(\"Dimensions of train: {}\".format(untouchedTestData.shape))" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": {}, + "outputs": [], + "source": [ + "# In the mission of creating sparse matrix, we will also need to change the male-female as 1 and 0 (In both the Dataframes)" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "Cannot compare types 'ndarray(dtype=int64)' and 'str'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mtrainData\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mtrainData\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mreplace\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m{\u001b[0m\u001b[1;34m'sex'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m{\u001b[0m\u001b[1;34m'male'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'female'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[0muntouchedTestData\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0muntouchedTestData\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mreplace\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m{\u001b[0m\u001b[1;34m'sex'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m{\u001b[0m\u001b[1;34m'male'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'female'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\frame.py\u001b[0m in \u001b[0;36mreplace\u001b[1;34m(self, to_replace, value, inplace, limit, regex, method)\u001b[0m\n\u001b[0;32m 3793\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mvalue\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0minplace\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0minplace\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3794\u001b[0m \u001b[0mlimit\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mlimit\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mregex\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mregex\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3795\u001b[1;33m method=method)\n\u001b[0m\u001b[0;32m 3796\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3797\u001b[0m \u001b[1;33m@\u001b[0m\u001b[0mAppender\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0m_shared_docs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'shift'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0m_shared_doc_kwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\generic.py\u001b[0m in \u001b[0;36mreplace\u001b[1;34m(self, to_replace, value, inplace, limit, regex, method)\u001b[0m\n\u001b[0;32m 5796\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5797\u001b[0m return self.replace(to_replace, value, inplace=inplace,\n\u001b[1;32m-> 5798\u001b[1;33m limit=limit, regex=regex)\n\u001b[0m\u001b[0;32m 5799\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5800\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\frame.py\u001b[0m in \u001b[0;36mreplace\u001b[1;34m(self, to_replace, value, inplace, limit, regex, method)\u001b[0m\n\u001b[0;32m 3793\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mvalue\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0minplace\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0minplace\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3794\u001b[0m \u001b[0mlimit\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mlimit\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mregex\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mregex\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3795\u001b[1;33m method=method)\n\u001b[0m\u001b[0;32m 3796\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3797\u001b[0m \u001b[1;33m@\u001b[0m\u001b[0mAppender\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0m_shared_docs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'shift'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0m_shared_doc_kwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\generic.py\u001b[0m in \u001b[0;36mreplace\u001b[1;34m(self, to_replace, value, inplace, limit, regex, method)\u001b[0m\n\u001b[0;32m 5815\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mvalue\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mc\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5816\u001b[0m \u001b[0minplace\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mFalse\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 5817\u001b[1;33m regex=regex)\n\u001b[0m\u001b[0;32m 5818\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[1;32mNone\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0minplace\u001b[0m \u001b[1;32melse\u001b[0m \u001b[0mres\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5819\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\series.py\u001b[0m in \u001b[0;36mreplace\u001b[1;34m(self, to_replace, value, inplace, limit, regex, method)\u001b[0m\n\u001b[0;32m 3427\u001b[0m return super(Series, self).replace(to_replace=to_replace, value=value,\n\u001b[0;32m 3428\u001b[0m \u001b[0minplace\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0minplace\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlimit\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mlimit\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3429\u001b[1;33m regex=regex, method=method)\n\u001b[0m\u001b[0;32m 3430\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3431\u001b[0m \u001b[1;33m@\u001b[0m\u001b[0mAppender\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mgeneric\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_shared_docs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'shift'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0m_shared_doc_kwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\generic.py\u001b[0m in \u001b[0;36mreplace\u001b[1;34m(self, to_replace, value, inplace, limit, regex, method)\u001b[0m\n\u001b[0;32m 5845\u001b[0m \u001b[0mdest_list\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mvalue\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5846\u001b[0m \u001b[0minplace\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0minplace\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 5847\u001b[1;33m regex=regex)\n\u001b[0m\u001b[0;32m 5848\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5849\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m \u001b[1;31m# [NA, ''] -> 0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\internals.py\u001b[0m in \u001b[0;36mreplace_list\u001b[1;34m(self, src_list, dest_list, inplace, regex, mgr)\u001b[0m\n\u001b[0;32m 3737\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0m_maybe_compare\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'asm8'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0moperator\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0meq\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3738\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3739\u001b[1;33m \u001b[0mmasks\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0mcomp\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0ms\u001b[0m \u001b[1;32min\u001b[0m \u001b[0menumerate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msrc_list\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3740\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3741\u001b[0m \u001b[0mresult_blocks\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\internals.py\u001b[0m in \u001b[0;36m\u001b[1;34m(.0)\u001b[0m\n\u001b[0;32m 3737\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0m_maybe_compare\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'asm8'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0moperator\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0meq\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3738\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3739\u001b[1;33m \u001b[0mmasks\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0mcomp\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0ms\u001b[0m \u001b[1;32min\u001b[0m \u001b[0menumerate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msrc_list\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3740\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3741\u001b[0m \u001b[0mresult_blocks\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\internals.py\u001b[0m in \u001b[0;36mcomp\u001b[1;34m(s)\u001b[0m\n\u001b[0;32m 3735\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0misna\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3736\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0misna\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3737\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0m_maybe_compare\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'asm8'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0moperator\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0meq\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3738\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3739\u001b[0m \u001b[0mmasks\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0mcomp\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0ms\u001b[0m \u001b[1;32min\u001b[0m \u001b[0menumerate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msrc_list\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\internals.py\u001b[0m in \u001b[0;36m_maybe_compare\u001b[1;34m(a, b, op)\u001b[0m\n\u001b[0;32m 5163\u001b[0m raise TypeError(\n\u001b[0;32m 5164\u001b[0m \"Cannot compare types {a!r} and {b!r}\".format(a=type_names[0],\n\u001b[1;32m-> 5165\u001b[1;33m b=type_names[1]))\n\u001b[0m\u001b[0;32m 5166\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5167\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mTypeError\u001b[0m: Cannot compare types 'ndarray(dtype=int64)' and 'str'" + ] + } + ], + "source": [ + "trainData = trainData.replace({'sex':{'male':1,'female':0}})\n", + "untouchedTestData = untouchedTestData.replace({'sex':{'male':1,'female':0}})" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": {}, + "outputs": [], + "source": [ + "#Now as for 7+3 newly created columns we have assigned 0 as default values ; but that's not we are going to take\n", + "#things forward. We need to assign respective values into the same.\n", + "#Explanation:\n", + "#In Training set, if the value of column PClass = 1 then , for mark newly created PClass1 column value as 1, and rest 0.\n", + "#Similarly\n", + "#If the value of column PClass = 3 then , for mark newly created PClass3 column value as 1, and rest 0.\n", + "#...\n", + "#...\n", + "#...\n", + "\n", + "\n", + "#This is Sparse Matrix Way!" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": {}, + "outputs": [], + "source": [ + " \n", + "trainData['PClass1'] = np.where(trainData['pclass']==1, '1', '0')\n", + "trainData['PClass2'] = np.where(trainData['pclass']==2, '1', '0')\n", + "trainData['PClass3'] = np.where(trainData['pclass']==3, '1', '0')\n", + "\n", + "trainData['Missing'] = np.where(trainData['Age_categories']==\"Missing\", '1', '0')\n", + "trainData['Infant'] = np.where(trainData['Age_categories']=='Infant', '1', '0')\n", + "trainData['Child'] = np.where(trainData['Age_categories']=='Child', '1', '0')\n", + "trainData['Teenager'] = np.where(trainData['Age_categories']=='Teenager', '1', '0')\n", + "trainData['Young Adult'] = np.where(trainData['Age_categories']=='Young Adult', '1', '0')\n", + "trainData['Adult'] = np.where(trainData['Age_categories']=='Adult', '1', '0')\n", + "trainData['Senior'] = np.where(trainData['Age_categories']=='Senior', '1', '0')\n", + "\n", + "#=======================================================================================================\n", + "\n", + "untouchedTestData['PClass1'] = np.where(untouchedTestData['pclass']==1, '1', '0')\n", + "untouchedTestData['PClass2'] = np.where(untouchedTestData['pclass']==2, '1', '0')\n", + "untouchedTestData['PClass3'] = np.where(untouchedTestData['pclass']==3, '1', '0')\n", + "\n", + "untouchedTestData['Missing'] = np.where(untouchedTestData['Age_categories']==\"Missing\", '1', '0')\n", + "untouchedTestData['Infant'] = np.where(untouchedTestData['Age_categories']=='Infant', '1', '0')\n", + "untouchedTestData['Child'] = np.where(untouchedTestData['Age_categories']=='Child', '1', '0')\n", + "untouchedTestData['Teenager'] = np.where(untouchedTestData['Age_categories']=='Teenager', '1', '0')\n", + "untouchedTestData['Young Adult'] = np.where(untouchedTestData['Age_categories']=='Young Adult', '1', '0')\n", + "untouchedTestData['Adult'] = np.where(untouchedTestData['Age_categories']=='Adult', '1', '0')\n", + "untouchedTestData['Senior'] = np.where(untouchedTestData['Age_categories']=='Senior', '1', '0')\n" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
pclasssurvivednamesexagesibspparchticketfarecabin...MissingInfantChildTeenagerYoung AdultAdultSeniorPClass1PClass2PClass3
011Allen, Miss. Elisabeth Walton029.00000024160211.3375B5...0000100100
111Allison, Master. Hudson Trevor10.916712113781151.5500C22 C26...0100000100
210Allison, Miss. Helen Loraine02.000012113781151.5500C22 C26...0100000100
310Allison, Mr. Hudson Joshua Creighton130.000012113781151.5500C22 C26...0000100100
410Allison, Mrs. Hudson J C (Bessie Waldo Daniels)025.000012113781151.5500C22 C26...0000100100
511Anderson, Mr. Harry148.0000001995226.5500E12...0000010100
611Andrews, Miss. Kornelia Theodosia063.0000101350277.9583D7...0000001100
710Andrews, Mr. Thomas Jr139.0000001120500.0000A36...0000010100
811Appleton, Mrs. Edward Dale (Charlotte Lamson)053.0000201176951.4792C101...0000010100
910Artagaveytia, Mr. Ramon171.000000PC 1760949.5042NaN...0000001100
1010Astor, Col. John Jacob147.000010PC 17757227.5250C62 C64...0000010100
1111Astor, Mrs. John Jacob (Madeleine Talmadge Force)018.000010PC 17757227.5250C62 C64...0001000100
\n", + "

12 rows × 25 columns

\n", + "
" + ], + "text/plain": [ + " pclass survived name sex \\\n", + "0 1 1 Allen, Miss. Elisabeth Walton 0 \n", + "1 1 1 Allison, Master. Hudson Trevor 1 \n", + "2 1 0 Allison, Miss. Helen Loraine 0 \n", + "3 1 0 Allison, Mr. Hudson Joshua Creighton 1 \n", + "4 1 0 Allison, Mrs. Hudson J C (Bessie Waldo Daniels) 0 \n", + "5 1 1 Anderson, Mr. Harry 1 \n", + "6 1 1 Andrews, Miss. Kornelia Theodosia 0 \n", + "7 1 0 Andrews, Mr. Thomas Jr 1 \n", + "8 1 1 Appleton, Mrs. Edward Dale (Charlotte Lamson) 0 \n", + "9 1 0 Artagaveytia, Mr. Ramon 1 \n", + "10 1 0 Astor, Col. John Jacob 1 \n", + "11 1 1 Astor, Mrs. John Jacob (Madeleine Talmadge Force) 0 \n", + "\n", + " age sibsp parch ticket fare cabin ... Missing Infant \\\n", + "0 29.0000 0 0 24160 211.3375 B5 ... 0 0 \n", + "1 0.9167 1 2 113781 151.5500 C22 C26 ... 0 1 \n", + "2 2.0000 1 2 113781 151.5500 C22 C26 ... 0 1 \n", + "3 30.0000 1 2 113781 151.5500 C22 C26 ... 0 0 \n", + "4 25.0000 1 2 113781 151.5500 C22 C26 ... 0 0 \n", + "5 48.0000 0 0 19952 26.5500 E12 ... 0 0 \n", + "6 63.0000 1 0 13502 77.9583 D7 ... 0 0 \n", + "7 39.0000 0 0 112050 0.0000 A36 ... 0 0 \n", + "8 53.0000 2 0 11769 51.4792 C101 ... 0 0 \n", + "9 71.0000 0 0 PC 17609 49.5042 NaN ... 0 0 \n", + "10 47.0000 1 0 PC 17757 227.5250 C62 C64 ... 0 0 \n", + "11 18.0000 1 0 PC 17757 227.5250 C62 C64 ... 0 0 \n", + "\n", + " Child Teenager Young Adult Adult Senior PClass1 PClass2 PClass3 \n", + "0 0 0 1 0 0 1 0 0 \n", + "1 0 0 0 0 0 1 0 0 \n", + "2 0 0 0 0 0 1 0 0 \n", + "3 0 0 1 0 0 1 0 0 \n", + "4 0 0 1 0 0 1 0 0 \n", + "5 0 0 0 1 0 1 0 0 \n", + "6 0 0 0 0 1 1 0 0 \n", + "7 0 0 0 1 0 1 0 0 \n", + "8 0 0 0 1 0 1 0 0 \n", + "9 0 0 0 0 1 1 0 0 \n", + "10 0 0 0 1 0 1 0 0 \n", + "11 0 1 0 0 0 1 0 0 \n", + "\n", + "[12 rows x 25 columns]" + ] + }, + "execution_count": 65, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "trainData.head(12)" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": {}, + "outputs": [], + "source": [ + "#Now choose the important variables (columns)" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": {}, + "outputs": [], + "source": [ + "selectdColumns = [\"sex\",\"Missing\",\"Infant\",\"Child\",\"Teenager\",\"Young Adult\",\"Adult\",\"Senior\",\"PClass1\", \"PClass2\", \"PClass3\"]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Now we have Sparse Matrix is prepared, time to apply ML modeling." + ] + }, + { + "cell_type": "code", + "execution_count": 75, + "metadata": {}, + "outputs": [], + "source": [ + "#lr = LogisticRegression()" + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": {}, + "outputs": [], + "source": [ + "#lr.fit(trainData[selectdColumns], trainData[\"survived\"])" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": {}, + "outputs": [], + "source": [ + "rf = RandomForestClassifier (n_estimators=100)" + ] + }, + { + "cell_type": "code", + "execution_count": 268, + "metadata": {}, + "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_impurity_decrease=0.0, min_impurity_split=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": 268, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "rf.fit(trainData[selectdColumns], trainData[\"survived\"])" + ] + }, + { + "cell_type": "code", + "execution_count": 77, + "metadata": {}, + "outputs": [], + "source": [ + "#IMPORTANT: NOW WE ARE SPLITTING OUR TRAIN DATAFRAME IN 80% 20% RATIO." + ] + }, + { + "cell_type": "code", + "execution_count": 78, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 0 0\n", + " 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0\n", + " 0 0 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0\n", + " 0 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 1 0 1 1 0 1 0 0 1 1 0 0 0 0 1 0 0\n", + " 0 0 0 1 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0]\n", + "0.8156424581005587\n" + ] + } + ], + "source": [ + "all_X = trainData[selectdColumns]\n", + "all_y = trainData['survived']\n", + "\n", + "train_X, test_X, train_y, test_y = train_test_split(\n", + " all_X, all_y, test_size=0.20,random_state=0)\n", + "\n", + "rf.fit(train_X, train_y)\n", + "predictions = rf.predict(test_X)\n", + "print(predictions)\n", + "accuracy = accuracy_score(test_y, predictions)\n", + "print(accuracy)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#10 FOLD CROSS VALIDATION- Therefore, 10 results in the List.\n", + "#Post that, taking mean of the calculated scores." + ] + }, + { + "cell_type": "code", + "execution_count": 79, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[0.56818182 0.61363636 0.75555556 0.77777778 0.80898876 0.80898876\n", + " 0.82222222 0.83333333 0.86363636 0.88764045]\n", + "0.7739961411871523\n" + ] + } + ], + "source": [ + "rf = RandomForestClassifier (n_estimators=100)\n", + "scores = cross_val_score(rf, all_X, all_y, cv=10)\n", + "scores.sort()\n", + "accuracy = scores.mean()\n", + "\n", + "print(scores)\n", + "print(accuracy)" + ] + }, + { + "cell_type": "code", + "execution_count": 271, + "metadata": {}, + "outputs": [], + "source": [ + "############ NOW TIME TO USE UNSEEN DATA #################" + ] + }, + { + "cell_type": "code", + "execution_count": 272, + "metadata": {}, + "outputs": [], + "source": [ + "holdout = untouchedTestData " + ] + }, + { + "cell_type": "code", + "execution_count": 273, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
sexMissingInfantChildTeenagerYoung AdultAdultSeniorPClass1PClass2PClass3
89110000100001
89210000100001
89310000100001
89410100000001
89500100000001
89610000010001
89710000100001
89810000100001
89900000100001
90011000000001
90101000000001
90211000000001
90301000000001
90410000100001
90510000100001
90610000100001
90700000100001
90800000100001
90910000100001
91010001000001
91110000100001
91210000100001
91310000100001
91410000100001
91510000100001
91600100000001
91710000010001
91811000000001
91910000100001
92011000000001
....................................
127900001000001
128010000100001
128110000100001
128211000000001
128311000000001
128411000000001
128510000100001
128600000010001
128710000010001
128810001000001
128910000100001
129000000010001
129111000000001
129211000000001
129311000000001
129410000100001
129510000100001
129610000100001
129711000000001
129810000010001
129910000100001
130000001000001
130110000010001
130211000000001
130311000000001
130400001000001
130501000000001
130610000100001
130710000100001
130810000100001
\n", + "

418 rows × 11 columns

\n", + "
" + ], + "text/plain": [ + " sex Missing Infant Child Teenager Young Adult Adult Senior PClass1 \\\n", + "891 1 0 0 0 0 1 0 0 0 \n", + "892 1 0 0 0 0 1 0 0 0 \n", + "893 1 0 0 0 0 1 0 0 0 \n", + "894 1 0 1 0 0 0 0 0 0 \n", + "895 0 0 1 0 0 0 0 0 0 \n", + "896 1 0 0 0 0 0 1 0 0 \n", + "897 1 0 0 0 0 1 0 0 0 \n", + "898 1 0 0 0 0 1 0 0 0 \n", + "899 0 0 0 0 0 1 0 0 0 \n", + "900 1 1 0 0 0 0 0 0 0 \n", + "901 0 1 0 0 0 0 0 0 0 \n", + "902 1 1 0 0 0 0 0 0 0 \n", + "903 0 1 0 0 0 0 0 0 0 \n", + "904 1 0 0 0 0 1 0 0 0 \n", + "905 1 0 0 0 0 1 0 0 0 \n", + "906 1 0 0 0 0 1 0 0 0 \n", + "907 0 0 0 0 0 1 0 0 0 \n", + "908 0 0 0 0 0 1 0 0 0 \n", + "909 1 0 0 0 0 1 0 0 0 \n", + "910 1 0 0 0 1 0 0 0 0 \n", + "911 1 0 0 0 0 1 0 0 0 \n", + "912 1 0 0 0 0 1 0 0 0 \n", + "913 1 0 0 0 0 1 0 0 0 \n", + "914 1 0 0 0 0 1 0 0 0 \n", + "915 1 0 0 0 0 1 0 0 0 \n", + "916 0 0 1 0 0 0 0 0 0 \n", + "917 1 0 0 0 0 0 1 0 0 \n", + "918 1 1 0 0 0 0 0 0 0 \n", + "919 1 0 0 0 0 1 0 0 0 \n", + "920 1 1 0 0 0 0 0 0 0 \n", + "... ... ... ... ... ... ... ... ... ... \n", + "1279 0 0 0 0 1 0 0 0 0 \n", + "1280 1 0 0 0 0 1 0 0 0 \n", + "1281 1 0 0 0 0 1 0 0 0 \n", + "1282 1 1 0 0 0 0 0 0 0 \n", + "1283 1 1 0 0 0 0 0 0 0 \n", + "1284 1 1 0 0 0 0 0 0 0 \n", + "1285 1 0 0 0 0 1 0 0 0 \n", + "1286 0 0 0 0 0 0 1 0 0 \n", + "1287 1 0 0 0 0 0 1 0 0 \n", + "1288 1 0 0 0 1 0 0 0 0 \n", + "1289 1 0 0 0 0 1 0 0 0 \n", + "1290 0 0 0 0 0 0 1 0 0 \n", + "1291 1 1 0 0 0 0 0 0 0 \n", + "1292 1 1 0 0 0 0 0 0 0 \n", + "1293 1 1 0 0 0 0 0 0 0 \n", + "1294 1 0 0 0 0 1 0 0 0 \n", + "1295 1 0 0 0 0 1 0 0 0 \n", + "1296 1 0 0 0 0 1 0 0 0 \n", + "1297 1 1 0 0 0 0 0 0 0 \n", + "1298 1 0 0 0 0 0 1 0 0 \n", + "1299 1 0 0 0 0 1 0 0 0 \n", + "1300 0 0 0 0 1 0 0 0 0 \n", + "1301 1 0 0 0 0 0 1 0 0 \n", + "1302 1 1 0 0 0 0 0 0 0 \n", + "1303 1 1 0 0 0 0 0 0 0 \n", + "1304 0 0 0 0 1 0 0 0 0 \n", + "1305 0 1 0 0 0 0 0 0 0 \n", + "1306 1 0 0 0 0 1 0 0 0 \n", + "1307 1 0 0 0 0 1 0 0 0 \n", + "1308 1 0 0 0 0 1 0 0 0 \n", + "\n", + " PClass2 PClass3 \n", + "891 0 1 \n", + "892 0 1 \n", + "893 0 1 \n", + "894 0 1 \n", + "895 0 1 \n", + "896 0 1 \n", + "897 0 1 \n", + "898 0 1 \n", + "899 0 1 \n", + "900 0 1 \n", + "901 0 1 \n", + "902 0 1 \n", + "903 0 1 \n", + "904 0 1 \n", + "905 0 1 \n", + "906 0 1 \n", + "907 0 1 \n", + "908 0 1 \n", + "909 0 1 \n", + "910 0 1 \n", + "911 0 1 \n", + "912 0 1 \n", + "913 0 1 \n", + "914 0 1 \n", + "915 0 1 \n", + "916 0 1 \n", + "917 0 1 \n", + "918 0 1 \n", + "919 0 1 \n", + "920 0 1 \n", + "... ... ... \n", + "1279 0 1 \n", + "1280 0 1 \n", + "1281 0 1 \n", + "1282 0 1 \n", + "1283 0 1 \n", + "1284 0 1 \n", + "1285 0 1 \n", + "1286 0 1 \n", + "1287 0 1 \n", + "1288 0 1 \n", + "1289 0 1 \n", + "1290 0 1 \n", + "1291 0 1 \n", + "1292 0 1 \n", + "1293 0 1 \n", + "1294 0 1 \n", + "1295 0 1 \n", + "1296 0 1 \n", + "1297 0 1 \n", + "1298 0 1 \n", + "1299 0 1 \n", + "1300 0 1 \n", + "1301 0 1 \n", + "1302 0 1 \n", + "1303 0 1 \n", + "1304 0 1 \n", + "1305 0 1 \n", + "1306 0 1 \n", + "1307 0 1 \n", + "1308 0 1 \n", + "\n", + "[418 rows x 11 columns]" + ] + }, + "execution_count": 273, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "holdout[columns]" + ] + }, + { + "cell_type": "code", + "execution_count": 274, + "metadata": {}, + "outputs": [], + "source": [ + "rf = RandomForestClassifier (n_estimators=100)\n", + "rf.fit(all_X,all_y)\n", + "predictions = rf.predict(holdout[columns])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 275, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0\n", + " 0 0 0 0 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", + " 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0\n", + " 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0\n", + " 0 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0\n", + " 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 0 1 1 0 1 0 0 0 0 0 0 0 1 1\n", + " 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0\n", + " 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0\n", + " 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1\n", + " 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1\n", + " 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", + " 0 0 1 0 0 0 1 0 0 0 0]\n" + ] + } + ], + "source": [ + "print(predictions)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#Now we have predictions. And from the CSV File we have the actual outputs.\n", + "#Let's assign the actual outputs from the CSV into cheatvalues" + ] + }, + { + "cell_type": "code", + "execution_count": 280, + "metadata": {}, + "outputs": [], + "source": [ + "cheatvalues = [0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0]" + ] + }, + { + "cell_type": "code", + "execution_count": 281, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "418" + ] + }, + "execution_count": 281, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(predictions)" + ] + }, + { + "cell_type": "code", + "execution_count": 282, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "418" + ] + }, + "execution_count": 282, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(cheatvalues)" + ] + }, + { + "cell_type": "code", + "execution_count": 283, + "metadata": {}, + "outputs": [], + "source": [ + "accuracy = accuracy_score(cheatvalues, predictions)" + ] + }, + { + "cell_type": "code", + "execution_count": 284, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.7296650717703349\n" + ] + } + ], + "source": [ + "print(accuracy)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#THE END " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.5" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 5a16b7ff09aec740b171804680b4f4fe274f3e3b Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 24 Aug 2018 14:54:25 +0530 Subject: [PATCH 02/39] Delete Titanic-DataQuest-Sparse.ipynb --- Titanic-DataQuest-Sparse.ipynb | 1989 -------------------------------- 1 file changed, 1989 deletions(-) delete mode 100644 Titanic-DataQuest-Sparse.ipynb diff --git a/Titanic-DataQuest-Sparse.ipynb b/Titanic-DataQuest-Sparse.ipynb deleted file mode 100644 index 1dda426..0000000 --- a/Titanic-DataQuest-Sparse.ipynb +++ /dev/null @@ -1,1989 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 255, - "metadata": {}, - "outputs": [], - "source": [ - "import numpy as np\n", - "import pandas as pd\n", - "from sklearn.ensemble import RandomForestClassifier\n", - "from sklearn.cross_validation import train_test_split\n", - "from sklearn.externals import joblib\n", - "from sklearn.naive_bayes import GaussianNB\n", - "from sklearn.linear_model import LogisticRegression\n", - "import numpy as np\n", - "from sklearn.metrics import accuracy_score\n", - "from sklearn.model_selection import cross_val_score" - ] - }, - { - "cell_type": "code", - "execution_count": 256, - "metadata": {}, - "outputs": [], - "source": [ - "titanicCompleteData= pd.read_csv(\"D:/DataScienceCollection/DataSets/Titanic/TitanicDataSet/titanic.csv\")" - ] - }, - { - "cell_type": "code", - "execution_count": 257, - "metadata": {}, - "outputs": [], - "source": [ - "trainData = titanicCompleteData.head(891)" - ] - }, - { - "cell_type": "code", - "execution_count": 258, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Dimensions of train: (891, 14)\n" - ] - } - ], - "source": [ - "print(\"Dimensions of train: {}\".format(trainData.shape))\n" - ] - }, - { - "cell_type": "code", - "execution_count": 259, - "metadata": {}, - "outputs": [], - "source": [ - "untouchedTestData = titanicCompleteData.tail(418)" - ] - }, - { - "cell_type": "code", - "execution_count": 260, - "metadata": {}, - "outputs": [], - "source": [ - "del untouchedTestData['survived']" - ] - }, - { - "cell_type": "code", - "execution_count": 261, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Dimensions of test: (418, 13)\n" - ] - } - ], - "source": [ - "print(\"Dimensions of test: {}\".format(untouchedTestData.shape))" - ] - }, - { - "cell_type": "code", - "execution_count": 262, - "metadata": {}, - "outputs": [], - "source": [ - "def process_age(df,cut_points,label_names):\n", - " df[\"age\"] = df[\"age\"].fillna(-0.5)\n", - " df[\"Age_categories\"] = pd.cut(df[\"age\"],cut_points,labels=label_names)\n", - " return df\n" - ] - }, - { - "cell_type": "code", - "execution_count": 263, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\Lenovo\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:2: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " \n", - "C:\\Users\\Lenovo\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:3: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " This is separate from the ipykernel package so we can avoid doing imports until\n" - ] - } - ], - "source": [ - "cut_points = [-1,0,5,12,18,35,60,100]\n", - "label_names = [\"Missing\",\"Infant\",\"Child\",\"Teenager\",\"Young Adult\",\"Adult\",\"Senior\"]\n", - "\n", - "trainData = process_age(trainData,cut_points,label_names)\n", - "untouchedTestData = process_age(untouchedTestData,cut_points,label_names)" - ] - }, - { - "cell_type": "code", - "execution_count": 264, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\Lenovo\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:4: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " after removing the cwd from sys.path.\n", - "C:\\Users\\Lenovo\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:7: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " import sys\n", - "C:\\Users\\Lenovo\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:12: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " if sys.path[0] == '':\n", - "C:\\Users\\Lenovo\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:15: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " from ipykernel import kernelapp as app\n" - ] - } - ], - "source": [ - "new_age_columns = [\"Missing\",\"Infant\",\"Child\",\"Teenager\",\"Young Adult\",\"Adult\",\"Senior\"]\n", - "\n", - "for newCol in new_age_columns:\n", - " trainData[newCol] =0\n", - " \n", - "for newCol in new_age_columns:\n", - " untouchedTestData[newCol] =0\n", - " \n", - " \n", - "new_class_columns = [\"PClass1\", \"PClass2\", \"PClass3\"]\n", - "for newCCol in new_class_columns:\n", - " trainData[newCCol] =0\n", - " \n", - "for newCCol in new_class_columns:\n", - " untouchedTestData[newCCol] =0\n", - " \n", - " \n", - "trainData = trainData.replace({'sex':{'male':1,'female':0}})\n", - "untouchedTestData = untouchedTestData.replace({'sex':{'male':1,'female':0}})" - ] - }, - { - "cell_type": "code", - "execution_count": 265, - "metadata": {}, - "outputs": [], - "source": [ - " \n", - "trainData['PClass1'] = np.where(trainData['pclass']==1, '1', '0')\n", - "trainData['PClass2'] = np.where(trainData['pclass']==2, '1', '0')\n", - "trainData['PClass3'] = np.where(trainData['pclass']==3, '1', '0')\n", - "\n", - "trainData['Missing'] = np.where(trainData['Age_categories']==\"Missing\", '1', '0')\n", - "trainData['Infant'] = np.where(trainData['Age_categories']=='Infant', '1', '0')\n", - "trainData['Child'] = np.where(trainData['Age_categories']=='Child', '1', '0')\n", - "trainData['Teenager'] = np.where(trainData['Age_categories']=='Teenager', '1', '0')\n", - "trainData['Young Adult'] = np.where(trainData['Age_categories']=='Young Adult', '1', '0')\n", - "trainData['Adult'] = np.where(trainData['Age_categories']=='Adult', '1', '0')\n", - "trainData['Senior'] = np.where(trainData['Age_categories']=='Senior', '1', '0')\n", - "\n", - "\n", - "untouchedTestData['PClass1'] = np.where(untouchedTestData['pclass']==1, '1', '0')\n", - "untouchedTestData['PClass2'] = np.where(untouchedTestData['pclass']==2, '1', '0')\n", - "untouchedTestData['PClass3'] = np.where(untouchedTestData['pclass']==3, '1', '0')\n", - "\n", - "untouchedTestData['Missing'] = np.where(untouchedTestData['Age_categories']==\"Missing\", '1', '0')\n", - "untouchedTestData['Infant'] = np.where(untouchedTestData['Age_categories']=='Infant', '1', '0')\n", - "untouchedTestData['Child'] = np.where(untouchedTestData['Age_categories']=='Child', '1', '0')\n", - "untouchedTestData['Teenager'] = np.where(untouchedTestData['Age_categories']=='Teenager', '1', '0')\n", - "untouchedTestData['Young Adult'] = np.where(untouchedTestData['Age_categories']=='Young Adult', '1', '0')\n", - "untouchedTestData['Adult'] = np.where(untouchedTestData['Age_categories']=='Adult', '1', '0')\n", - "untouchedTestData['Senior'] = np.where(untouchedTestData['Age_categories']=='Senior', '1', '0')\n" - ] - }, - { - "cell_type": "code", - "execution_count": 266, - "metadata": {}, - "outputs": [], - "source": [ - "selectdColumns = [\"sex\",\"Missing\",\"Infant\",\"Child\",\"Teenager\",\"Young Adult\",\"Adult\",\"Senior\",\"PClass1\", \"PClass2\", \"PClass3\"]" - ] - }, - { - "cell_type": "code", - "execution_count": 267, - "metadata": {}, - "outputs": [], - "source": [ - "rf = RandomForestClassifier (n_estimators=100)" - ] - }, - { - "cell_type": "code", - "execution_count": 268, - "metadata": {}, - "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_impurity_decrease=0.0, min_impurity_split=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": 268, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "rf.fit(trainData[selectdColumns], trainData[\"survived\"])" - ] - }, - { - "cell_type": "code", - "execution_count": 269, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 1 1\n", - " 0 1 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0\n", - " 0 0 1 0 0 1 0 1 0 0 0 0 1 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0\n", - " 0 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 1 0 1 1 0 1 0 0 1 1 0 0 0 0 1 0 0\n", - " 0 0 0 1 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0]\n", - "0.8212290502793296\n" - ] - } - ], - "source": [ - "\n", - "\n", - "all_X = trainData[columns]\n", - "all_y = trainData['survived']\n", - "\n", - "train_X, test_X, train_y, test_y = train_test_split(\n", - " all_X, all_y, test_size=0.20,random_state=0)\n", - "\n", - "rf.fit(train_X, train_y)\n", - "predictions = rf.predict(test_X)\n", - "print(predictions)\n", - "accuracy = accuracy_score(test_y, predictions)\n", - "print(accuracy)" - ] - }, - { - "cell_type": "code", - "execution_count": 270, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[0.56818182 0.61363636 0.75555556 0.77777778 0.80898876 0.80898876\n", - " 0.82222222 0.83333333 0.86363636 0.88764045]\n", - "0.7739961411871523\n" - ] - } - ], - "source": [ - "rf = RandomForestClassifier (n_estimators=100)\n", - "scores = cross_val_score(rf, all_X, all_y, cv=10)\n", - "scores.sort()\n", - "accuracy = scores.mean()\n", - "\n", - "print(scores)\n", - "print(accuracy)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": 271, - "metadata": {}, - "outputs": [], - "source": [ - "############ NOW TIME TO USE UNSEEN DATA #################" - ] - }, - { - "cell_type": "code", - "execution_count": 272, - "metadata": {}, - "outputs": [], - "source": [ - "\n", - "holdout = untouchedTestData \n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": 273, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
sexMissingInfantChildTeenagerYoung AdultAdultSeniorPClass1PClass2PClass3
89110000100001
89210000100001
89310000100001
89410100000001
89500100000001
89610000010001
89710000100001
89810000100001
89900000100001
90011000000001
90101000000001
90211000000001
90301000000001
90410000100001
90510000100001
90610000100001
90700000100001
90800000100001
90910000100001
91010001000001
91110000100001
91210000100001
91310000100001
91410000100001
91510000100001
91600100000001
91710000010001
91811000000001
91910000100001
92011000000001
....................................
127900001000001
128010000100001
128110000100001
128211000000001
128311000000001
128411000000001
128510000100001
128600000010001
128710000010001
128810001000001
128910000100001
129000000010001
129111000000001
129211000000001
129311000000001
129410000100001
129510000100001
129610000100001
129711000000001
129810000010001
129910000100001
130000001000001
130110000010001
130211000000001
130311000000001
130400001000001
130501000000001
130610000100001
130710000100001
130810000100001
\n", - "

418 rows × 11 columns

\n", - "
" - ], - "text/plain": [ - " sex Missing Infant Child Teenager Young Adult Adult Senior PClass1 \\\n", - "891 1 0 0 0 0 1 0 0 0 \n", - "892 1 0 0 0 0 1 0 0 0 \n", - "893 1 0 0 0 0 1 0 0 0 \n", - "894 1 0 1 0 0 0 0 0 0 \n", - "895 0 0 1 0 0 0 0 0 0 \n", - "896 1 0 0 0 0 0 1 0 0 \n", - "897 1 0 0 0 0 1 0 0 0 \n", - "898 1 0 0 0 0 1 0 0 0 \n", - "899 0 0 0 0 0 1 0 0 0 \n", - "900 1 1 0 0 0 0 0 0 0 \n", - "901 0 1 0 0 0 0 0 0 0 \n", - "902 1 1 0 0 0 0 0 0 0 \n", - "903 0 1 0 0 0 0 0 0 0 \n", - "904 1 0 0 0 0 1 0 0 0 \n", - "905 1 0 0 0 0 1 0 0 0 \n", - "906 1 0 0 0 0 1 0 0 0 \n", - "907 0 0 0 0 0 1 0 0 0 \n", - "908 0 0 0 0 0 1 0 0 0 \n", - "909 1 0 0 0 0 1 0 0 0 \n", - "910 1 0 0 0 1 0 0 0 0 \n", - "911 1 0 0 0 0 1 0 0 0 \n", - "912 1 0 0 0 0 1 0 0 0 \n", - "913 1 0 0 0 0 1 0 0 0 \n", - "914 1 0 0 0 0 1 0 0 0 \n", - "915 1 0 0 0 0 1 0 0 0 \n", - "916 0 0 1 0 0 0 0 0 0 \n", - "917 1 0 0 0 0 0 1 0 0 \n", - "918 1 1 0 0 0 0 0 0 0 \n", - "919 1 0 0 0 0 1 0 0 0 \n", - "920 1 1 0 0 0 0 0 0 0 \n", - "... ... ... ... ... ... ... ... ... ... \n", - "1279 0 0 0 0 1 0 0 0 0 \n", - "1280 1 0 0 0 0 1 0 0 0 \n", - "1281 1 0 0 0 0 1 0 0 0 \n", - "1282 1 1 0 0 0 0 0 0 0 \n", - "1283 1 1 0 0 0 0 0 0 0 \n", - "1284 1 1 0 0 0 0 0 0 0 \n", - "1285 1 0 0 0 0 1 0 0 0 \n", - "1286 0 0 0 0 0 0 1 0 0 \n", - "1287 1 0 0 0 0 0 1 0 0 \n", - "1288 1 0 0 0 1 0 0 0 0 \n", - "1289 1 0 0 0 0 1 0 0 0 \n", - "1290 0 0 0 0 0 0 1 0 0 \n", - "1291 1 1 0 0 0 0 0 0 0 \n", - "1292 1 1 0 0 0 0 0 0 0 \n", - "1293 1 1 0 0 0 0 0 0 0 \n", - "1294 1 0 0 0 0 1 0 0 0 \n", - "1295 1 0 0 0 0 1 0 0 0 \n", - "1296 1 0 0 0 0 1 0 0 0 \n", - "1297 1 1 0 0 0 0 0 0 0 \n", - "1298 1 0 0 0 0 0 1 0 0 \n", - "1299 1 0 0 0 0 1 0 0 0 \n", - "1300 0 0 0 0 1 0 0 0 0 \n", - "1301 1 0 0 0 0 0 1 0 0 \n", - "1302 1 1 0 0 0 0 0 0 0 \n", - "1303 1 1 0 0 0 0 0 0 0 \n", - "1304 0 0 0 0 1 0 0 0 0 \n", - "1305 0 1 0 0 0 0 0 0 0 \n", - "1306 1 0 0 0 0 1 0 0 0 \n", - "1307 1 0 0 0 0 1 0 0 0 \n", - "1308 1 0 0 0 0 1 0 0 0 \n", - "\n", - " PClass2 PClass3 \n", - "891 0 1 \n", - "892 0 1 \n", - "893 0 1 \n", - "894 0 1 \n", - "895 0 1 \n", - "896 0 1 \n", - "897 0 1 \n", - "898 0 1 \n", - "899 0 1 \n", - "900 0 1 \n", - "901 0 1 \n", - "902 0 1 \n", - "903 0 1 \n", - "904 0 1 \n", - "905 0 1 \n", - "906 0 1 \n", - "907 0 1 \n", - "908 0 1 \n", - "909 0 1 \n", - "910 0 1 \n", - "911 0 1 \n", - "912 0 1 \n", - "913 0 1 \n", - "914 0 1 \n", - "915 0 1 \n", - "916 0 1 \n", - "917 0 1 \n", - "918 0 1 \n", - "919 0 1 \n", - "920 0 1 \n", - "... ... ... \n", - "1279 0 1 \n", - "1280 0 1 \n", - "1281 0 1 \n", - "1282 0 1 \n", - "1283 0 1 \n", - "1284 0 1 \n", - "1285 0 1 \n", - "1286 0 1 \n", - "1287 0 1 \n", - "1288 0 1 \n", - "1289 0 1 \n", - "1290 0 1 \n", - "1291 0 1 \n", - "1292 0 1 \n", - "1293 0 1 \n", - "1294 0 1 \n", - "1295 0 1 \n", - "1296 0 1 \n", - "1297 0 1 \n", - "1298 0 1 \n", - "1299 0 1 \n", - "1300 0 1 \n", - "1301 0 1 \n", - "1302 0 1 \n", - "1303 0 1 \n", - "1304 0 1 \n", - "1305 0 1 \n", - "1306 0 1 \n", - "1307 0 1 \n", - "1308 0 1 \n", - "\n", - "[418 rows x 11 columns]" - ] - }, - "execution_count": 273, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "holdout[columns]" - ] - }, - { - "cell_type": "code", - "execution_count": 274, - "metadata": {}, - "outputs": [], - "source": [ - "rf = RandomForestClassifier (n_estimators=100)\n", - "rf.fit(all_X,all_y)\n", - "predictions = rf.predict(holdout[columns])\n" - ] - }, - { - "cell_type": "code", - "execution_count": 275, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0\n", - " 0 0 0 0 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", - " 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0\n", - " 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0\n", - " 0 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0\n", - " 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 0 1 1 0 1 0 0 0 0 0 0 0 1 1\n", - " 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0\n", - " 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0\n", - " 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1\n", - " 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1\n", - " 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", - " 0 0 1 0 0 0 1 0 0 0 0]\n" - ] - } - ], - "source": [ - "print(predictions)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": 280, - "metadata": {}, - "outputs": [], - "source": [ - "cheatvalues = [0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0]" - ] - }, - { - "cell_type": "code", - "execution_count": 281, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "418" - ] - }, - "execution_count": 281, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "len(predictions)" - ] - }, - { - "cell_type": "code", - "execution_count": 282, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "418" - ] - }, - "execution_count": 282, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "len(cheatvalues)" - ] - }, - { - "cell_type": "code", - "execution_count": 283, - "metadata": {}, - "outputs": [], - "source": [ - "accuracy = accuracy_score(cheatvalues, predictions)" - ] - }, - { - "cell_type": "code", - "execution_count": 284, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.7296650717703349\n" - ] - } - ], - "source": [ - "print(accuracy)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.4" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 143fc291cda9a2babe9023eb63000e57c8297cc0 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 24 Aug 2018 14:57:21 +0530 Subject: [PATCH 03/39] Add files via upload --- SplitPictoriaclRepresentation.png | Bin 0 -> 22970 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 SplitPictoriaclRepresentation.png diff --git a/SplitPictoriaclRepresentation.png b/SplitPictoriaclRepresentation.png new file mode 100644 index 0000000000000000000000000000000000000000..c3c997c39e23a764988818997ede265dbb12ea8a GIT binary patch literal 22970 zcmeHvXH-*L*De?hqM-;XL8Mr*aDa#sl`5#9sGz9GQHntW3WRC^sS%}!Gz-0o3Mzv1 zUW5p!GzFvtq#8gHdarkGP6N;DH|`zx{o=mXEengb`iY}Q&fDrT!`W@m*S#x1#g)Byx>Y>N=z{r7eCnlF z>Ee1D6y|O!Z5N4JjeV}cdiu$pGD7E_`xi}hxZgb|iELf7=GN{(_9?BHJ8Mo}UcY|B zv9l|;aX%bX_;Bcf)I|9y;=@*qGTkw9Vkp?YGCWIp^H8qT#2L$UR#*><;zcD4@-NG^ z-PFZ@6$AeJ!GGoPzpoCA#}1>PRYtn2T2pU4qM^%J_UzruCw^t}oBco*^MN}SWa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`{X{(-)xX&~$Ge01=!IHn6iuvI2@3h7(hOI$Ml>{ng`1fN=X;a%gGu z(1x1jrQ}0(KqfRYQg|Vm^{2+dA4fDG%*h+F6U|oSEHhh3MOu2ur+#aAiEvY*vA+}| z<{Fe{fE5meD2tc_<)Qd0AKy&}K61SO<%V7p`LisoGs?Gq{aw9XvoOR+8-kN{YW}Bh z?KG}WU;-Y|nc!P=D~&@iTwl*A4+H+>?Hhk7c>`@IKlgaK0?W}rf-fJY*qN%ct;h6# z?*9Gl6NAfZUurVHwCXFY!5+4bYjNm%lfjTr`sMZfXDlp|bmj!03&DRv`tASXyGC@eshD{$auEu6$K202VVz&ix-Kt%}7 zG)cNW_M@6@MF3>aIWncc^bQPjr2-YPJ$80>z)i3gpz*`&EgzJDA;-e_O7%nIexpXZ z72W~|*1()2z>Z*7q?a;vl`P*;2vywX7`vKIPE!HMD&U-;T!S1(GCge#6?b^Vn~$63sjeJJ-ijPVZnTTK&m=f@W+!ub~`QzIP)FTz7Yil2y2+Asd_ ze5CtB`&~$MK*3#(iyriA2=hxv2_Ygg}RtO zw1uWGpjd@$+gNQfmUfXdwv<9m@|pk?ry#xMQagE)SQ%zluVXU@C;M$uaLNT%-qMBs z_hg{|O5pzw31|qSz^fX9*mqmE9-qoyf4TgiHJDEGN{en8=hfvx(6-^Pm&S!wqH}PjkWW z^fT>i^`dB>EJo9)Dspg^$;`y;jgi=Iq0-K+iKWl^x{x!$daj~s>@sCab^R-g<)*un zdS#o}a Date: Fri, 24 Aug 2018 17:25:11 +0530 Subject: [PATCH 04/39] Add files via upload --- Titanic-DataQuest.ipynb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Titanic-DataQuest.ipynb b/Titanic-DataQuest.ipynb index 9063416..1f47c0b 100644 --- a/Titanic-DataQuest.ipynb +++ b/Titanic-DataQuest.ipynb @@ -244,7 +244,7 @@ "# Right now our Training Dataframe is of (891,15) dimention.\n", "# and our Testing Dataframe is of (418, 14) dimention.\n", "\n", - "#Now, we are going introducing 7+3 columns (in both Training and Testing Dataframes)\n", + "#Now, we are going to introduce 7+3 columns (in both Training and Testing Dataframes)\n", "#7 new columns will be for ages. Default values = 0 \n", "#3 new columns will be for class.Default values = 0 " ] @@ -384,8 +384,7 @@ "metadata": {}, "outputs": [], "source": [ - "#Now as for 7+3 newly created columns we have assigned 0 as default values ; but that's not we are going to take\n", - "#things forward. We need to assign respective values into the same.\n", + "#Now as for 7+3 newly created columns we have assigned 0 as default values ; but that's not going to take things forward. We need to assign respective values into the same.\n", "#Explanation:\n", "#In Training set, if the value of column PClass = 1 then , for mark newly created PClass1 column value as 1, and rest 0.\n", "#Similarly\n", From 7a17d5536cabf40f3e42ade42087a477b26dc09c Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 24 Aug 2018 17:27:13 +0530 Subject: [PATCH 05/39] Add files via upload --- Titanic-DataQuest.ipynb | 148 +++++++++++++++++----------------------- 1 file changed, 63 insertions(+), 85 deletions(-) diff --git a/Titanic-DataQuest.ipynb b/Titanic-DataQuest.ipynb index 1f47c0b..b933e51 100644 --- a/Titanic-DataQuest.ipynb +++ b/Titanic-DataQuest.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 32, + "execution_count": 80, "metadata": {}, "outputs": [], "source": [ @@ -20,7 +20,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 81, "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 82, "metadata": {}, "outputs": [], "source": [ @@ -38,7 +38,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 83, "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 84, "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 85, "metadata": {}, "outputs": [ { @@ -73,7 +73,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 86, "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 87, "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 88, "metadata": {}, "outputs": [], "source": [ @@ -104,7 +104,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 89, "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 90, "metadata": {}, "outputs": [ { @@ -130,7 +130,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 91, "metadata": {}, "outputs": [], "source": [ @@ -149,7 +149,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 92, "metadata": {}, "outputs": [], "source": [ @@ -161,7 +161,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 93, "metadata": {}, "outputs": [ { @@ -193,7 +193,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 94, "metadata": {}, "outputs": [], "source": [ @@ -203,7 +203,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 95, "metadata": {}, "outputs": [ { @@ -220,7 +220,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 96, "metadata": {}, "outputs": [ { @@ -237,7 +237,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 97, "metadata": {}, "outputs": [], "source": [ @@ -251,7 +251,7 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 98, "metadata": {}, "outputs": [ { @@ -305,7 +305,7 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 99, "metadata": {}, "outputs": [ { @@ -322,7 +322,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 100, "metadata": {}, "outputs": [ { @@ -339,7 +339,7 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 101, "metadata": {}, "outputs": [], "source": [ @@ -348,31 +348,9 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 102, "metadata": {}, - "outputs": [ - { - "ename": "TypeError", - "evalue": "Cannot compare types 'ndarray(dtype=int64)' and 'str'", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mtrainData\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mtrainData\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mreplace\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m{\u001b[0m\u001b[1;34m'sex'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m{\u001b[0m\u001b[1;34m'male'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'female'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[0muntouchedTestData\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0muntouchedTestData\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mreplace\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m{\u001b[0m\u001b[1;34m'sex'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m{\u001b[0m\u001b[1;34m'male'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'female'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\frame.py\u001b[0m in \u001b[0;36mreplace\u001b[1;34m(self, to_replace, value, inplace, limit, regex, method)\u001b[0m\n\u001b[0;32m 3793\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mvalue\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0minplace\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0minplace\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3794\u001b[0m \u001b[0mlimit\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mlimit\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mregex\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mregex\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3795\u001b[1;33m method=method)\n\u001b[0m\u001b[0;32m 3796\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3797\u001b[0m \u001b[1;33m@\u001b[0m\u001b[0mAppender\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0m_shared_docs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'shift'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0m_shared_doc_kwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\generic.py\u001b[0m in \u001b[0;36mreplace\u001b[1;34m(self, to_replace, value, inplace, limit, regex, method)\u001b[0m\n\u001b[0;32m 5796\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5797\u001b[0m return self.replace(to_replace, value, inplace=inplace,\n\u001b[1;32m-> 5798\u001b[1;33m limit=limit, regex=regex)\n\u001b[0m\u001b[0;32m 5799\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5800\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\frame.py\u001b[0m in \u001b[0;36mreplace\u001b[1;34m(self, to_replace, value, inplace, limit, regex, method)\u001b[0m\n\u001b[0;32m 3793\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mvalue\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0minplace\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0minplace\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3794\u001b[0m \u001b[0mlimit\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mlimit\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mregex\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mregex\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3795\u001b[1;33m method=method)\n\u001b[0m\u001b[0;32m 3796\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3797\u001b[0m \u001b[1;33m@\u001b[0m\u001b[0mAppender\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0m_shared_docs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'shift'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0m_shared_doc_kwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\generic.py\u001b[0m in \u001b[0;36mreplace\u001b[1;34m(self, to_replace, value, inplace, limit, regex, method)\u001b[0m\n\u001b[0;32m 5815\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mvalue\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mc\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5816\u001b[0m \u001b[0minplace\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mFalse\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 5817\u001b[1;33m regex=regex)\n\u001b[0m\u001b[0;32m 5818\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[1;32mNone\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0minplace\u001b[0m \u001b[1;32melse\u001b[0m \u001b[0mres\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5819\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\series.py\u001b[0m in \u001b[0;36mreplace\u001b[1;34m(self, to_replace, value, inplace, limit, regex, method)\u001b[0m\n\u001b[0;32m 3427\u001b[0m return super(Series, self).replace(to_replace=to_replace, value=value,\n\u001b[0;32m 3428\u001b[0m \u001b[0minplace\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0minplace\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlimit\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mlimit\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3429\u001b[1;33m regex=regex, method=method)\n\u001b[0m\u001b[0;32m 3430\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3431\u001b[0m \u001b[1;33m@\u001b[0m\u001b[0mAppender\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mgeneric\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_shared_docs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'shift'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0m_shared_doc_kwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\generic.py\u001b[0m in \u001b[0;36mreplace\u001b[1;34m(self, to_replace, value, inplace, limit, regex, method)\u001b[0m\n\u001b[0;32m 5845\u001b[0m \u001b[0mdest_list\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mvalue\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5846\u001b[0m \u001b[0minplace\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0minplace\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 5847\u001b[1;33m regex=regex)\n\u001b[0m\u001b[0;32m 5848\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5849\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m \u001b[1;31m# [NA, ''] -> 0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\internals.py\u001b[0m in \u001b[0;36mreplace_list\u001b[1;34m(self, src_list, dest_list, inplace, regex, mgr)\u001b[0m\n\u001b[0;32m 3737\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0m_maybe_compare\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'asm8'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0moperator\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0meq\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3738\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3739\u001b[1;33m \u001b[0mmasks\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0mcomp\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0ms\u001b[0m \u001b[1;32min\u001b[0m \u001b[0menumerate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msrc_list\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3740\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3741\u001b[0m \u001b[0mresult_blocks\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\internals.py\u001b[0m in \u001b[0;36m\u001b[1;34m(.0)\u001b[0m\n\u001b[0;32m 3737\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0m_maybe_compare\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'asm8'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0moperator\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0meq\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3738\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3739\u001b[1;33m \u001b[0mmasks\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0mcomp\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0ms\u001b[0m \u001b[1;32min\u001b[0m \u001b[0menumerate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msrc_list\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3740\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3741\u001b[0m \u001b[0mresult_blocks\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\internals.py\u001b[0m in \u001b[0;36mcomp\u001b[1;34m(s)\u001b[0m\n\u001b[0;32m 3735\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0misna\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3736\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0misna\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3737\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0m_maybe_compare\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'asm8'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0moperator\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0meq\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3738\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3739\u001b[0m \u001b[0mmasks\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0mcomp\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ms\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0ms\u001b[0m \u001b[1;32min\u001b[0m \u001b[0menumerate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msrc_list\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pandas\\core\\internals.py\u001b[0m in \u001b[0;36m_maybe_compare\u001b[1;34m(a, b, op)\u001b[0m\n\u001b[0;32m 5163\u001b[0m raise TypeError(\n\u001b[0;32m 5164\u001b[0m \"Cannot compare types {a!r} and {b!r}\".format(a=type_names[0],\n\u001b[1;32m-> 5165\u001b[1;33m b=type_names[1]))\n\u001b[0m\u001b[0;32m 5166\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5167\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;31mTypeError\u001b[0m: Cannot compare types 'ndarray(dtype=int64)' and 'str'" - ] - } - ], + "outputs": [], "source": [ "trainData = trainData.replace({'sex':{'male':1,'female':0}})\n", "untouchedTestData = untouchedTestData.replace({'sex':{'male':1,'female':0}})" @@ -380,7 +358,7 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 103, "metadata": {}, "outputs": [], "source": [ @@ -399,7 +377,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 104, "metadata": {}, "outputs": [], "source": [ @@ -433,7 +411,7 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 105, "metadata": {}, "outputs": [ { @@ -820,7 +798,7 @@ "[12 rows x 25 columns]" ] }, - "execution_count": 65, + "execution_count": 105, "metadata": {}, "output_type": "execute_result" } @@ -831,7 +809,7 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 106, "metadata": {}, "outputs": [], "source": [ @@ -840,7 +818,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 107, "metadata": {}, "outputs": [], "source": [ @@ -849,7 +827,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 108, "metadata": {}, "outputs": [], "source": [ @@ -858,7 +836,7 @@ }, { "cell_type": "code", - "execution_count": 75, + "execution_count": 109, "metadata": {}, "outputs": [], "source": [ @@ -867,7 +845,7 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": 110, "metadata": {}, "outputs": [], "source": [ @@ -876,7 +854,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 111, "metadata": {}, "outputs": [], "source": [ @@ -885,7 +863,7 @@ }, { "cell_type": "code", - "execution_count": 268, + "execution_count": 112, "metadata": {}, "outputs": [ { @@ -900,7 +878,7 @@ " warm_start=False)" ] }, - "execution_count": 268, + "execution_count": 112, "metadata": {}, "output_type": "execute_result" } @@ -911,7 +889,7 @@ }, { "cell_type": "code", - "execution_count": 77, + "execution_count": 113, "metadata": {}, "outputs": [], "source": [ @@ -920,19 +898,19 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": 114, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 0 0\n", - " 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0\n", - " 0 0 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0\n", + "[0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0\n", + " 0 1 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0\n", + " 0 0 1 0 0 1 0 1 0 0 0 0 1 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0\n", " 0 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 1 0 1 1 0 1 0 0 1 1 0 0 0 0 1 0 0\n", " 0 0 0 1 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0]\n", - "0.8156424581005587\n" + "0.8100558659217877\n" ] } ], @@ -952,7 +930,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 115, "metadata": {}, "outputs": [], "source": [ @@ -962,15 +940,15 @@ }, { "cell_type": "code", - "execution_count": 79, + "execution_count": 116, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[0.56818182 0.61363636 0.75555556 0.77777778 0.80898876 0.80898876\n", - " 0.82222222 0.83333333 0.86363636 0.88764045]\n", + "[0.56818182 0.60227273 0.75555556 0.77777778 0.80898876 0.80898876\n", + " 0.82222222 0.83333333 0.875 0.88764045]\n", "0.7739961411871523\n" ] } @@ -987,7 +965,7 @@ }, { "cell_type": "code", - "execution_count": 271, + "execution_count": 122, "metadata": {}, "outputs": [], "source": [ @@ -996,7 +974,7 @@ }, { "cell_type": "code", - "execution_count": 272, + "execution_count": 123, "metadata": {}, "outputs": [], "source": [ @@ -1005,7 +983,7 @@ }, { "cell_type": "code", - "execution_count": 273, + "execution_count": 124, "metadata": {}, "outputs": [ { @@ -2032,29 +2010,29 @@ "[418 rows x 11 columns]" ] }, - "execution_count": 273, + "execution_count": 124, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "holdout[columns]" + "holdout[selectdColumns]" ] }, { "cell_type": "code", - "execution_count": 274, + "execution_count": 125, "metadata": {}, "outputs": [], "source": [ "rf = RandomForestClassifier (n_estimators=100)\n", "rf.fit(all_X,all_y)\n", - "predictions = rf.predict(holdout[columns])\n" + "predictions = rf.predict(holdout[selectdColumns])\n" ] }, { "cell_type": "code", - "execution_count": 275, + "execution_count": 126, "metadata": {}, "outputs": [ { @@ -2082,7 +2060,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 127, "metadata": {}, "outputs": [], "source": [ @@ -2092,7 +2070,7 @@ }, { "cell_type": "code", - "execution_count": 280, + "execution_count": 128, "metadata": {}, "outputs": [], "source": [ @@ -2518,7 +2496,7 @@ }, { "cell_type": "code", - "execution_count": 281, + "execution_count": 129, "metadata": {}, "outputs": [ { @@ -2527,7 +2505,7 @@ "418" ] }, - "execution_count": 281, + "execution_count": 129, "metadata": {}, "output_type": "execute_result" } @@ -2538,7 +2516,7 @@ }, { "cell_type": "code", - "execution_count": 282, + "execution_count": 130, "metadata": {}, "outputs": [ { @@ -2547,7 +2525,7 @@ "418" ] }, - "execution_count": 282, + "execution_count": 130, "metadata": {}, "output_type": "execute_result" } @@ -2558,7 +2536,7 @@ }, { "cell_type": "code", - "execution_count": 283, + "execution_count": 131, "metadata": {}, "outputs": [], "source": [ @@ -2567,7 +2545,7 @@ }, { "cell_type": "code", - "execution_count": 284, + "execution_count": 132, "metadata": {}, "outputs": [ { @@ -2584,7 +2562,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 133, "metadata": {}, "outputs": [], "source": [ From 2b5f41f895d96f10567bf98601ce9559fcac4b0e Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 24 Aug 2018 18:19:46 +0530 Subject: [PATCH 06/39] Add files via upload --- IRIS.ipynb | 1392 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1392 insertions(+) create mode 100644 IRIS.ipynb diff --git a/IRIS.ipynb b/IRIS.ipynb new file mode 100644 index 0000000..f57bf40 --- /dev/null +++ b/IRIS.ipynb @@ -0,0 +1,1392 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "from sklearn.ensemble import RandomForestClassifier\n", + "from sklearn.cross_validation import train_test_split\n", + "from sklearn.externals import joblib\n", + "from sklearn.naive_bayes import GaussianNB\n", + "from sklearn.linear_model import LogisticRegression\n", + "import numpy as np\n", + "from sklearn.metrics import accuracy_score\n", + "from sklearn.model_selection import cross_val_score" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [], + "source": [ + "#Loading the complete File" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [], + "source": [ + "titanicCompleteData= pd.read_csv(\"C:/MyFolder/iris.csv\")" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [], + "source": [ + "#In the file we have total 148 records. From these records we have decided to keep 120 for training purpose." + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [], + "source": [ + "trainData = titanicCompleteData.head(120)" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimensions of train: (120, 5)\n" + ] + } + ], + "source": [ + "print(\"Dimensions of train: {}\".format(trainData.shape))\n" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [], + "source": [ + "#The reamining 28 records will be used for testing purpose." + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [], + "source": [ + "untouchedTestData = titanicCompleteData.tail(28)" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [], + "source": [ + "#From the test records, we are deleting the 'class' columns.\n", + "#ONE THING IMPORTANT IS THAT WE ARE NOT DELETING FROM THE ACTUAL FILE BUT FROM THE DATAFRAME.\n", + "#ANOTHER IMPORTANT THING IS THAT- HERE WE HAVE ONE FILE WHICH WE HAVE DIVIDED INTO TWO DATAFRAMES.\n", + "#IF WE WERE GIVEN TWO FILES (TEST & TRAIN) WE COULD HAVE SIMPLY LOADED BOTH OF THEM INTO TWO DIFFERENT DATAFRAMES.\n", + "#ONE FILE | TWO FILE APPROACH MAKES NO DIFFERENCE ! " + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [], + "source": [ + "del untouchedTestData['class']" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimensions of test: (28, 4)\n" + ] + } + ], + "source": [ + "print(\"Dimensions of test: {}\".format(untouchedTestData.shape))" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [], + "source": [ + "# Right now our Training Dataframe is of (120, 5) dimention.\n", + "# and our Testing Dataframe is of (28, 4) dimention.\n", + "\n", + "#Now, we are going introduce 3 new columns (in both Training and Testing Dataframes)\n", + "#3 new columns will be for class.Default values = 0 [SPARSE MATRIX WAY !!!]" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:4: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", + " after removing the cwd from sys.path.\n", + "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:7: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", + " import sys\n" + ] + } + ], + "source": [ + "new_age_columns = [\"Iris-setosa\",\"Iris-versicolor\",\"Iris-virginica\"]\n", + "\n", + "for newCol in new_age_columns:\n", + " trainData[newCol] =0\n", + " \n", + "for newCol in new_age_columns:\n", + " untouchedTestData[newCol] =0\n", + " \n" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimensions of train: (120, 8)\n" + ] + } + ], + "source": [ + "print(\"Dimensions of train: {}\".format(trainData.shape))" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimensions of train: (28, 7)\n" + ] + } + ], + "source": [ + "print(\"Dimensions of train: {}\".format(untouchedTestData.shape))" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [], + "source": [ + "#Now as for 3 newly created columns we have assigned 0 as default values ; but that's not going to take things forward. We need to assign respective values into the same.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:2: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", + " \n", + "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:3: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", + " This is separate from the ipykernel package so we can avoid doing imports until\n", + "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:4: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", + " after removing the cwd from sys.path.\n" + ] + } + ], + "source": [ + "trainData['Iris-setosa'] = np.where(trainData['class']==1, '1', '0')\n", + "trainData['Iris-versicolor'] = np.where(trainData['class']==2, '1', '0')\n", + "trainData['Iris-virginica'] = np.where(trainData['class']==3, '1', '0')" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": {}, + "outputs": [], + "source": [ + "#Now choose the important variables (columns)" + ] + }, + { + "cell_type": "code", + "execution_count": 85, + "metadata": {}, + "outputs": [], + "source": [ + "selectdColumns = [\"sepallength\",\"sepalwidth\",\"petallength\",\"petalwidth\",\"Iris-setosa\",\"Iris-versicolor\",\"Iris-virginica\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 93, + "metadata": {}, + "outputs": [], + "source": [ + "# Now we have Sparse Matrix is prepared, time to apply ML modeling." + ] + }, + { + "cell_type": "code", + "execution_count": 94, + "metadata": {}, + "outputs": [], + "source": [ + "lr = GaussianNB()" + ] + }, + { + "cell_type": "code", + "execution_count": 95, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "GaussianNB(priors=None)" + ] + }, + "execution_count": 95, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "lr.fit(trainData[selectdColumns], trainData[\"class\"])" + ] + }, + { + "cell_type": "code", + "execution_count": 96, + "metadata": {}, + "outputs": [], + "source": [ + "#IMPORTANT: NOW WE ARE SPLITTING OUR TRAIN DATAFRAME IN 80% 20% RATIO." + ] + }, + { + "cell_type": "code", + "execution_count": 90, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[2 2 2 1 2 1 1 1 1 2 1 2 1 2 3 2 1 1 3 2 2 2 1 1]\n", + "1.0\n" + ] + } + ], + "source": [ + "all_X = trainData[selectdColumns]\n", + "all_y = trainData['class']\n", + "\n", + "train_X, test_X, train_y, test_y = train_test_split(\n", + " all_X, all_y, test_size=0.20,random_state=0)\n", + "\n", + "rf.fit(train_X, train_y)\n", + "predictions = rf.predict(test_X)\n", + "print(predictions)\n", + "accuracy = accuracy_score(test_y, predictions)\n", + "print(accuracy)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#10 FOLD CROSS VALIDATION- Therefore, 10 results in the List.\n", + "#Post that, taking mean of the calculated scores." + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]\n", + "1.0\n" + ] + } + ], + "source": [ + "rf = RandomForestClassifier (n_estimators=100)\n", + "scores = cross_val_score(rf, all_X, all_y, cv=10)\n", + "scores.sort()\n", + "accuracy = scores.mean()\n", + "\n", + "print(scores)\n", + "print(accuracy)" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": {}, + "outputs": [], + "source": [ + "############ NOW TIME TO USE UNSEEN DATA #################" + ] + }, + { + "cell_type": "code", + "execution_count": 91, + "metadata": {}, + "outputs": [], + "source": [ + "holdout = untouchedTestData " + ] + }, + { + "cell_type": "code", + "execution_count": 92, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
sepallengthsepalwidthpetallengthpetalwidthIris-setosaIris-versicolorIris-virginica
1207.72.86.72.0000
1216.32.74.91.8000
1226.73.35.72.1000
1237.23.26.01.8000
1246.22.84.81.8000
1256.13.04.91.8000
1266.42.85.62.1000
1277.23.05.81.6000
1287.42.86.11.9000
1297.93.86.42.0000
1306.42.85.62.2000
1316.32.85.11.5000
1326.12.65.61.4000
1337.73.06.12.3000
1346.33.45.62.4000
1356.43.15.51.8000
1366.03.04.81.8000
1376.93.15.42.1000
1386.73.15.62.4000
1396.93.15.12.3000
1405.82.75.11.9000
1416.83.25.92.3000
1426.73.35.72.5000
1436.73.05.22.3000
1446.32.55.01.9000
1456.53.05.22.0000
1466.23.45.42.3000
1475.93.05.11.8000
\n", + "
" + ], + "text/plain": [ + " sepallength sepalwidth petallength petalwidth Iris-setosa \\\n", + "120 7.7 2.8 6.7 2.0 0 \n", + "121 6.3 2.7 4.9 1.8 0 \n", + "122 6.7 3.3 5.7 2.1 0 \n", + "123 7.2 3.2 6.0 1.8 0 \n", + "124 6.2 2.8 4.8 1.8 0 \n", + "125 6.1 3.0 4.9 1.8 0 \n", + "126 6.4 2.8 5.6 2.1 0 \n", + "127 7.2 3.0 5.8 1.6 0 \n", + "128 7.4 2.8 6.1 1.9 0 \n", + "129 7.9 3.8 6.4 2.0 0 \n", + "130 6.4 2.8 5.6 2.2 0 \n", + "131 6.3 2.8 5.1 1.5 0 \n", + "132 6.1 2.6 5.6 1.4 0 \n", + "133 7.7 3.0 6.1 2.3 0 \n", + "134 6.3 3.4 5.6 2.4 0 \n", + "135 6.4 3.1 5.5 1.8 0 \n", + "136 6.0 3.0 4.8 1.8 0 \n", + "137 6.9 3.1 5.4 2.1 0 \n", + "138 6.7 3.1 5.6 2.4 0 \n", + "139 6.9 3.1 5.1 2.3 0 \n", + "140 5.8 2.7 5.1 1.9 0 \n", + "141 6.8 3.2 5.9 2.3 0 \n", + "142 6.7 3.3 5.7 2.5 0 \n", + "143 6.7 3.0 5.2 2.3 0 \n", + "144 6.3 2.5 5.0 1.9 0 \n", + "145 6.5 3.0 5.2 2.0 0 \n", + "146 6.2 3.4 5.4 2.3 0 \n", + "147 5.9 3.0 5.1 1.8 0 \n", + "\n", + " Iris-versicolor Iris-virginica \n", + "120 0 0 \n", + "121 0 0 \n", + "122 0 0 \n", + "123 0 0 \n", + "124 0 0 \n", + "125 0 0 \n", + "126 0 0 \n", + "127 0 0 \n", + "128 0 0 \n", + "129 0 0 \n", + "130 0 0 \n", + "131 0 0 \n", + "132 0 0 \n", + "133 0 0 \n", + "134 0 0 \n", + "135 0 0 \n", + "136 0 0 \n", + "137 0 0 \n", + "138 0 0 \n", + "139 0 0 \n", + "140 0 0 \n", + "141 0 0 \n", + "142 0 0 \n", + "143 0 0 \n", + "144 0 0 \n", + "145 0 0 \n", + "146 0 0 \n", + "147 0 0 " + ] + }, + "execution_count": 92, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "holdout[selectdColumns]" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": {}, + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'columns' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[0mrf\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mRandomForestClassifier\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mn_estimators\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m100\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[0mrf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfit\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mall_X\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mall_y\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[0mpredictions\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mrf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpredict\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mholdout\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mNameError\u001b[0m: name 'columns' is not defined" + ] + } + ], + "source": [ + "rf = RandomForestClassifier (n_estimators=100)\n", + "rf.fit(all_X,all_y)\n", + "predictions = rf.predict(holdout[selectdColumns])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 275, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0\n", + " 0 0 0 0 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", + " 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0\n", + " 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0\n", + " 0 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0\n", + " 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 0 1 1 0 1 0 0 0 0 0 0 0 1 1\n", + " 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0\n", + " 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0\n", + " 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1\n", + " 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1\n", + " 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", + " 0 0 1 0 0 0 1 0 0 0 0]\n" + ] + } + ], + "source": [ + "print(predictions)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#Now we have predictions. And from the CSV File we have the actual outputs.\n", + "#Let's assign the actual outputs from the CSV into cheatvalues" + ] + }, + { + "cell_type": "code", + "execution_count": 280, + "metadata": {}, + "outputs": [], + "source": [ + "cheatvalues = [0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "1,\n", + "0,\n", + "1,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "1,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0,\n", + "0]" + ] + }, + { + "cell_type": "code", + "execution_count": 281, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "418" + ] + }, + "execution_count": 281, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(predictions)" + ] + }, + { + "cell_type": "code", + "execution_count": 282, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "418" + ] + }, + "execution_count": 282, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(cheatvalues)" + ] + }, + { + "cell_type": "code", + "execution_count": 283, + "metadata": {}, + "outputs": [], + "source": [ + "accuracy = accuracy_score(cheatvalues, predictions)" + ] + }, + { + "cell_type": "code", + "execution_count": 284, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.7296650717703349\n" + ] + } + ], + "source": [ + "print(accuracy)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#THE END " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.5" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From b64fa3bd73719d38fed04975a1741a615db76d45 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 24 Aug 2018 18:19:57 +0530 Subject: [PATCH 07/39] Add files via upload --- iris.csv | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 iris.csv di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+7.6,3.0,6.6,2.1,3 +4.9,2.5,4.5,1.7,3 +7.3,2.9,6.3,1.8,3 +6.7,2.5,5.8,1.8,3 +7.2,3.6,6.1,2.5,3 +6.5,3.2,5.1,2.0,3 +6.4,2.7,5.3,1.9,3 +6.8,3.0,5.5,2.1,3 +5.7,2.5,5.0,2.0,3 +5.8,2.8,5.1,2.4,3 +6.4,3.2,5.3,2.3,3 +6.5,3.0,5.5,1.8,3 +7.7,3.8,6.7,2.2,3 +7.7,2.6,6.9,2.3,3 +6.0,2.2,5.0,1.5,3 +6.9,3.2,5.7,2.3,3 +5.6,2.8,4.9,2.0,3 +7.7,2.8,6.7,2.0,3 +6.3,2.7,4.9,1.8,3 +6.7,3.3,5.7,2.1,3 +7.2,3.2,6.0,1.8,3 +6.2,2.8,4.8,1.8,3 +6.1,3.0,4.9,1.8,3 +6.4,2.8,5.6,2.1,3 +7.2,3.0,5.8,1.6,3 +7.4,2.8,6.1,1.9,3 +7.9,3.8,6.4,2.0,3 +6.4,2.8,5.6,2.2,3 +6.3,2.8,5.1,1.5,3 +6.1,2.6,5.6,1.4,3 +7.7,3.0,6.1,2.3,3 +6.3,3.4,5.6,2.4,3 +6.4,3.1,5.5,1.8,3 +6.0,3.0,4.8,1.8,3 +6.9,3.1,5.4,2.1,3 +6.7,3.1,5.6,2.4,3 +6.9,3.1,5.1,2.3,3 +5.8,2.7,5.1,1.9,3 +6.8,3.2,5.9,2.3,3 +6.7,3.3,5.7,2.5,3 +6.7,3.0,5.2,2.3,3 +6.3,2.5,5.0,1.9,3 +6.5,3.0,5.2,2.0,3 +6.2,3.4,5.4,2.3,3 +5.9,3.0,5.1,1.8,3 \ No newline at end of file From aebb0d3941a3cc88d365473fd778828651191a29 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 24 Aug 2018 19:56:10 +0530 Subject: [PATCH 08/39] Add files via upload --- IRIS.ipynb | 1096 ++++------------------------------------------------ 1 file changed, 67 insertions(+), 1029 deletions(-) diff --git a/IRIS.ipynb b/IRIS.ipynb index f57bf40..3e1cd26 100644 --- a/IRIS.ipynb +++ b/IRIS.ipynb @@ -2,9 +2,18 @@ "cells": [ { "cell_type": "code", - "execution_count": 31, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.\n", + " \"This module will be removed in 0.20.\", DeprecationWarning)\n" + ] + } + ], "source": [ "import numpy as np\n", "import pandas as pd\n", @@ -15,12 +24,13 @@ "from sklearn.linear_model import LogisticRegression\n", "import numpy as np\n", "from sklearn.metrics import accuracy_score\n", - "from sklearn.model_selection import cross_val_score" + "from sklearn.model_selection import cross_val_score\n", + "from sklearn import metrics" ] }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -29,41 +39,41 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ - "titanicCompleteData= pd.read_csv(\"C:/MyFolder/iris.csv\")" + "irisCompleteData= pd.read_csv(\"C:/MyFolder/iris.csv\")" ] }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ - "#In the file we have total 148 records. From these records we have decided to keep 120 for training purpose." + "#In the file we have total 148 records. From these records we have decided to keep 140 for training purpose." ] }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ - "trainData = titanicCompleteData.head(120)" + "trainData = irisCompleteData.head(140)" ] }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Dimensions of train: (120, 5)\n" + "Dimensions of train: (140, 5)\n" ] } ], @@ -73,25 +83,25 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ - "#The reamining 28 records will be used for testing purpose." + "#The reamining 8 records will be used for testing purpose." ] }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ - "untouchedTestData = titanicCompleteData.tail(28)" + "untouchedTestData = irisCompleteData.tail(8)" ] }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -104,7 +114,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -113,14 +123,14 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Dimensions of test: (28, 4)\n" + "Dimensions of test: (8, 4)\n" ] } ], @@ -130,7 +140,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -143,7 +153,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -178,14 +188,14 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Dimensions of train: (120, 8)\n" + "Dimensions of train: (140, 8)\n" ] } ], @@ -195,14 +205,14 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Dimensions of train: (28, 7)\n" + "Dimensions of train: (8, 7)\n" ] } ], @@ -212,40 +222,41 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ - "#Now as for 3 newly created columns we have assigned 0 as default values ; but that's not going to take things forward. We need to assign respective values into the same.\n" + "#Now as for 3 newly created columns we have assigned 0 as default values ; but that's not going to take things forward.\n", + "#We need to assign respective values into the same.\n" ] }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:2: SettingWithCopyWarning: \n", + "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " \n", - "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:3: SettingWithCopyWarning: \n", + " \"\"\"Entry point for launching an IPython kernel.\n", + "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:2: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " This is separate from the ipykernel package so we can avoid doing imports until\n", - "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:4: SettingWithCopyWarning: \n", + " \n", + "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:3: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " after removing the cwd from sys.path.\n" + " This is separate from the ipykernel package so we can avoid doing imports until\n" ] } ], @@ -257,7 +268,7 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -266,7 +277,7 @@ }, { "cell_type": "code", - "execution_count": 85, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -275,7 +286,7 @@ }, { "cell_type": "code", - "execution_count": 93, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ @@ -284,7 +295,7 @@ }, { "cell_type": "code", - "execution_count": 94, + "execution_count": 21, "metadata": {}, "outputs": [], "source": [ @@ -293,7 +304,7 @@ }, { "cell_type": "code", - "execution_count": 95, + "execution_count": 22, "metadata": {}, "outputs": [ { @@ -302,7 +313,7 @@ "GaussianNB(priors=None)" ] }, - "execution_count": 95, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } @@ -313,24 +324,15 @@ }, { "cell_type": "code", - "execution_count": 96, - "metadata": {}, - "outputs": [], - "source": [ - "#IMPORTANT: NOW WE ARE SPLITTING OUR TRAIN DATAFRAME IN 80% 20% RATIO." - ] - }, - { - "cell_type": "code", - "execution_count": 90, + "execution_count": 23, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[2 2 2 1 2 1 1 1 1 2 1 2 1 2 3 2 1 1 3 2 2 2 1 1]\n", - "1.0\n" + "[1 2 1 2 2 1 3 3 3 1 3 1 2 2 3 2 3 3 1 2 2 1 3 1 1 2 1 2]\n", + "28\n" ] } ], @@ -341,1017 +343,53 @@ "train_X, test_X, train_y, test_y = train_test_split(\n", " all_X, all_y, test_size=0.20,random_state=0)\n", "\n", - "rf.fit(train_X, train_y)\n", - "predictions = rf.predict(test_X)\n", + "lr.fit(train_X, train_y)\n", + "predictions = lr.predict(test_X)\n", "print(predictions)\n", - "accuracy = accuracy_score(test_y, predictions)\n", - "print(accuracy)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "#10 FOLD CROSS VALIDATION- Therefore, 10 results in the List.\n", - "#Post that, taking mean of the calculated scores." - ] - }, - { - "cell_type": "code", - "execution_count": 69, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]\n", - "1.0\n" - ] - } - ], - "source": [ - "rf = RandomForestClassifier (n_estimators=100)\n", - "scores = cross_val_score(rf, all_X, all_y, cv=10)\n", - "scores.sort()\n", - "accuracy = scores.mean()\n", + "print(len(predictions))\n", + "\n", "\n", - "print(scores)\n", - "print(accuracy)" + "\n" ] }, { "cell_type": "code", - "execution_count": 70, + "execution_count": null, "metadata": {}, "outputs": [], - "source": [ - "############ NOW TIME TO USE UNSEEN DATA #################" - ] + "source": [] }, { "cell_type": "code", - "execution_count": 91, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ "holdout = untouchedTestData " ] }, - { - "cell_type": "code", - "execution_count": 92, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
sepallengthsepalwidthpetallengthpetalwidthIris-setosaIris-versicolorIris-virginica
1207.72.86.72.0000
1216.32.74.91.8000
1226.73.35.72.1000
1237.23.26.01.8000
1246.22.84.81.8000
1256.13.04.91.8000
1266.42.85.62.1000
1277.23.05.81.6000
1287.42.86.11.9000
1297.93.86.42.0000
1306.42.85.62.2000
1316.32.85.11.5000
1326.12.65.61.4000
1337.73.06.12.3000
1346.33.45.62.4000
1356.43.15.51.8000
1366.03.04.81.8000
1376.93.15.42.1000
1386.73.15.62.4000
1396.93.15.12.3000
1405.82.75.11.9000
1416.83.25.92.3000
1426.73.35.72.5000
1436.73.05.22.3000
1446.32.55.01.9000
1456.53.05.22.0000
1466.23.45.42.3000
1475.93.05.11.8000
\n", - "
" - ], - "text/plain": [ - " sepallength sepalwidth petallength petalwidth Iris-setosa \\\n", - "120 7.7 2.8 6.7 2.0 0 \n", - "121 6.3 2.7 4.9 1.8 0 \n", - "122 6.7 3.3 5.7 2.1 0 \n", - "123 7.2 3.2 6.0 1.8 0 \n", - "124 6.2 2.8 4.8 1.8 0 \n", - "125 6.1 3.0 4.9 1.8 0 \n", - "126 6.4 2.8 5.6 2.1 0 \n", - "127 7.2 3.0 5.8 1.6 0 \n", - "128 7.4 2.8 6.1 1.9 0 \n", - "129 7.9 3.8 6.4 2.0 0 \n", - "130 6.4 2.8 5.6 2.2 0 \n", - "131 6.3 2.8 5.1 1.5 0 \n", - "132 6.1 2.6 5.6 1.4 0 \n", - "133 7.7 3.0 6.1 2.3 0 \n", - "134 6.3 3.4 5.6 2.4 0 \n", - "135 6.4 3.1 5.5 1.8 0 \n", - "136 6.0 3.0 4.8 1.8 0 \n", - "137 6.9 3.1 5.4 2.1 0 \n", - "138 6.7 3.1 5.6 2.4 0 \n", - "139 6.9 3.1 5.1 2.3 0 \n", - "140 5.8 2.7 5.1 1.9 0 \n", - "141 6.8 3.2 5.9 2.3 0 \n", - "142 6.7 3.3 5.7 2.5 0 \n", - "143 6.7 3.0 5.2 2.3 0 \n", - "144 6.3 2.5 5.0 1.9 0 \n", - "145 6.5 3.0 5.2 2.0 0 \n", - "146 6.2 3.4 5.4 2.3 0 \n", - "147 5.9 3.0 5.1 1.8 0 \n", - "\n", - " Iris-versicolor Iris-virginica \n", - "120 0 0 \n", - "121 0 0 \n", - "122 0 0 \n", - "123 0 0 \n", - "124 0 0 \n", - "125 0 0 \n", - "126 0 0 \n", - "127 0 0 \n", - "128 0 0 \n", - "129 0 0 \n", - "130 0 0 \n", - "131 0 0 \n", - "132 0 0 \n", - "133 0 0 \n", - "134 0 0 \n", - "135 0 0 \n", - "136 0 0 \n", - "137 0 0 \n", - "138 0 0 \n", - "139 0 0 \n", - "140 0 0 \n", - "141 0 0 \n", - "142 0 0 \n", - "143 0 0 \n", - "144 0 0 \n", - "145 0 0 \n", - "146 0 0 \n", - "147 0 0 " - ] - }, - "execution_count": 92, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "holdout[selectdColumns]" - ] - }, - { - "cell_type": "code", - "execution_count": 73, - "metadata": {}, - "outputs": [ - { - "ename": "NameError", - "evalue": "name 'columns' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[0mrf\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mRandomForestClassifier\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mn_estimators\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m100\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[0mrf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfit\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mall_X\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mall_y\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[0mpredictions\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mrf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpredict\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mholdout\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;31mNameError\u001b[0m: name 'columns' is not defined" - ] - } - ], - "source": [ - "rf = RandomForestClassifier (n_estimators=100)\n", - "rf.fit(all_X,all_y)\n", - "predictions = rf.predict(holdout[selectdColumns])\n" - ] - }, - { - "cell_type": "code", - "execution_count": 275, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0\n", - " 0 0 0 0 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", - " 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0\n", - " 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0\n", - " 0 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0\n", - " 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 0 1 1 0 1 0 0 0 0 0 0 0 1 1\n", - " 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0\n", - " 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0\n", - " 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1\n", - " 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1\n", - " 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", - " 0 0 1 0 0 0 1 0 0 0 0]\n" - ] - } - ], - "source": [ - "print(predictions)" - ] - }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "#Now we have predictions. And from the CSV File we have the actual outputs.\n", - "#Let's assign the actual outputs from the CSV into cheatvalues" - ] - }, - { - "cell_type": "code", - "execution_count": 280, - "metadata": {}, - "outputs": [], - "source": [ - "cheatvalues = [0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0]" - ] - }, - { - "cell_type": "code", - "execution_count": 281, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "418" - ] - }, - "execution_count": 281, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "len(predictions)" + "predictions = rf.predict(holdout[selectdColumns])" ] }, { "cell_type": "code", - "execution_count": 282, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "418" - ] - }, - "execution_count": 282, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "len(cheatvalues)" - ] - }, - { - "cell_type": "code", - "execution_count": 283, + "execution_count": null, "metadata": {}, "outputs": [], - "source": [ - "accuracy = accuracy_score(cheatvalues, predictions)" - ] - }, - { - "cell_type": "code", - "execution_count": 284, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.7296650717703349\n" - ] - } - ], - "source": [ - "print(accuracy)" - ] + "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], - "source": [ - "#THE END " - ] + "source": [] }, { "cell_type": "code", From 9eab6c498593064134266735cb338b3220fca51d Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 24 Aug 2018 20:05:43 +0530 Subject: [PATCH 09/39] Add files via upload --- IRIS.ipynb | 176 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 131 insertions(+), 45 deletions(-) diff --git a/IRIS.ipynb b/IRIS.ipynb index 3e1cd26..e3fa828 100644 --- a/IRIS.ipynb +++ b/IRIS.ipynb @@ -2,18 +2,9 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 24, "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.\n", - " \"This module will be removed in 0.20.\", DeprecationWarning)\n" - ] - } - ], + "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", @@ -30,7 +21,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 25, "metadata": {}, "outputs": [], "source": [ @@ -39,7 +30,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ @@ -48,7 +39,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 27, "metadata": {}, "outputs": [], "source": [ @@ -57,7 +48,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 28, "metadata": {}, "outputs": [], "source": [ @@ -66,7 +57,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 29, "metadata": {}, "outputs": [ { @@ -83,7 +74,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 30, "metadata": {}, "outputs": [], "source": [ @@ -92,7 +83,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 31, "metadata": {}, "outputs": [], "source": [ @@ -101,7 +92,41 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "140\n" + ] + } + ], + "source": [ + "print(len(trainData))" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "8\n" + ] + } + ], + "source": [ + "print(len(untouchedTestData))" + ] + }, + { + "cell_type": "code", + "execution_count": 35, "metadata": {}, "outputs": [], "source": [ @@ -114,7 +139,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 36, "metadata": {}, "outputs": [], "source": [ @@ -123,7 +148,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 37, "metadata": {}, "outputs": [ { @@ -140,7 +165,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 38, "metadata": {}, "outputs": [], "source": [ @@ -153,7 +178,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 39, "metadata": {}, "outputs": [ { @@ -188,7 +213,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 40, "metadata": {}, "outputs": [ { @@ -205,7 +230,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 41, "metadata": {}, "outputs": [ { @@ -222,7 +247,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 42, "metadata": {}, "outputs": [], "source": [ @@ -232,7 +257,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 43, "metadata": {}, "outputs": [ { @@ -268,7 +293,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 44, "metadata": {}, "outputs": [], "source": [ @@ -277,7 +302,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 45, "metadata": {}, "outputs": [], "source": [ @@ -286,7 +311,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 46, "metadata": {}, "outputs": [], "source": [ @@ -295,7 +320,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 47, "metadata": {}, "outputs": [], "source": [ @@ -304,7 +329,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 48, "metadata": {}, "outputs": [ { @@ -313,7 +338,7 @@ "GaussianNB(priors=None)" ] }, - "execution_count": 22, + "execution_count": 48, "metadata": {}, "output_type": "execute_result" } @@ -324,15 +349,49 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 49, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[1 2 1 2 2 1 3 3 3 1 3 1 2 2 3 2 3 3 1 2 2 1 3 1 1 2 1 2]\n", - "28\n" + "140\n" + ] + } + ], + "source": [ + "print(len(trainData))" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "8\n" + ] + } + ], + "source": [ + "print(len(untouchedTestData))" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[1 1 3 3 3 1 2 2 2 3 1 3 1 3 1 1 1 2 2 3 2 2 2 1 1 1 1 1 1 2 3 2 1 1 3]\n", + "35\n" ] } ], @@ -354,14 +413,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 55, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]\n", + "1.0\n" + ] + } + ], + "source": [ + "\n", + "scores = cross_val_score(lr, all_X, all_y, cv=10)\n", + "scores.sort()\n", + "accuracy = scores.mean()\n", + "\n", + "print(scores)\n", + "print(accuracy)" + ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 56, "metadata": {}, "outputs": [], "source": [ @@ -370,19 +446,29 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 58, "metadata": {}, "outputs": [], "source": [ - "predictions = rf.predict(holdout[selectdColumns])" + "predictions = lr.predict(holdout[selectdColumns])" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 59, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[3 3 3 3 3 3 3 3]\n" + ] + } + ], + "source": [ + "print(predictions)" + ] }, { "cell_type": "code", From f387b005da37aba0ea304c4af812bb5201df8b9c Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Sat, 25 Aug 2018 06:29:49 +0530 Subject: [PATCH 10/39] Delete titanic.csv --- titanic.csv | 1310 --------------------------------------------------- 1 file changed, 1310 deletions(-) delete mode 100644 titanic.csv diff --git a/titanic.csv b/titanic.csv deleted file mode 100644 index bd0e2cd..0000000 --- a/titanic.csv +++ /dev/null @@ -1,1310 +0,0 @@ -"pclass","survived","name","sex","age","sibsp","parch","ticket","fare","cabin","embarked","boat","body","home.dest" -"1","1","Allen, Miss. Elisabeth Walton","female","29","0","0","24160","211.3375","B5","S","2","","St Louis, MO" -"1","1","Allison, Master. Hudson Trevor","male","0.9167","1","2","113781","151.55","C22 C26","S","11","","Montreal, PQ / Chesterville, ON" -"1","0","Allison, Miss. Helen Loraine","female","2","1","2","113781","151.55","C22 C26","S","","","Montreal, PQ / Chesterville, ON" -"1","0","Allison, Mr. Hudson Joshua Creighton","male","30","1","2","113781","151.55","C22 C26","S","","135","Montreal, PQ / Chesterville, ON" -"1","0","Allison, Mrs. Hudson J C (Bessie Waldo Daniels)","female","25","1","2","113781","151.55","C22 C26","S","","","Montreal, PQ / Chesterville, ON" -"1","1","Anderson, Mr. Harry","male","48","0","0","19952","26.55","E12","S","3","","New York, NY" -"1","1","Andrews, Miss. Kornelia Theodosia","female","63","1","0","13502","77.95829999999999","D7","S","10","","Hudson, NY" -"1","0","Andrews, Mr. Thomas Jr","male","39","0","0","112050","0","A36","S","","","Belfast, NI" -"1","1","Appleton, Mrs. Edward Dale (Charlotte Lamson)","female","53","2","0","11769","51.4792","C101","S","D","","Bayside, Queens, NY" -"1","0","Artagaveytia, Mr. Ramon","male","71","0","0","PC 17609","49.5042","","C","","22","Montevideo, Uruguay" -"1","0","Astor, Col. John Jacob","male","47","1","0","PC 17757","227.525","C62 C64","C","","124","New York, NY" -"1","1","Astor, Mrs. John Jacob (Madeleine Talmadge Force)","female","18","1","0","PC 17757","227.525","C62 C64","C","4","","New York, NY" -"1","1","Aubart, Mme. Leontine Pauline","female","24","0","0","PC 17477","69.3","B35","C","9","","Paris, France" -"1","1","Barber, Miss. Ellen ""Nellie""","female","26","0","0","19877","78.84999999999999","","S","6","","" -"1","1","Barkworth, Mr. Algernon Henry Wilson","male","80","0","0","27042","30","A23","S","B","","Hessle, Yorks" -"1","0","Baumann, Mr. John D","male","","0","0","PC 17318","25.925","","S","","","New York, NY" -"1","0","Baxter, Mr. Quigg Edmond","male","24","0","1","PC 17558","247.5208","B58 B60","C","","","Montreal, PQ" -"1","1","Baxter, Mrs. James (Helene DeLaudeniere Chaput)","female","50","0","1","PC 17558","247.5208","B58 B60","C","6","","Montreal, PQ" -"1","1","Bazzani, Miss. Albina","female","32","0","0","11813","76.29170000000001","D15","C","8","","" -"1","0","Beattie, Mr. Thomson","male","36","0","0","13050","75.24169999999999","C6","C","A","","Winnipeg, MN" -"1","1","Beckwith, Mr. Richard Leonard","male","37","1","1","11751","52.5542","D35","S","5","","New York, NY" -"1","1","Beckwith, Mrs. Richard Leonard (Sallie Monypeny)","female","47","1","1","11751","52.5542","D35","S","5","","New York, NY" -"1","1","Behr, Mr. Karl Howell","male","26","0","0","111369","30","C148","C","5","","New York, NY" -"1","1","Bidois, Miss. Rosalie","female","42","0","0","PC 17757","227.525","","C","4","","" -"1","1","Bird, Miss. Ellen","female","29","0","0","PC 17483","221.7792","C97","S","8","","" -"1","0","Birnbaum, Mr. Jakob","male","25","0","0","13905","26","","C","","148","San Francisco, CA" -"1","1","Bishop, Mr. Dickinson H","male","25","1","0","11967","91.0792","B49","C","7","","Dowagiac, MI" -"1","1","Bishop, Mrs. Dickinson H (Helen Walton)","female","19","1","0","11967","91.0792","B49","C","7","","Dowagiac, MI" -"1","1","Bissette, Miss. Amelia","female","35","0","0","PC 17760","135.6333","C99","S","8","","" -"1","1","Bjornstrom-Steffansson, Mr. Mauritz Hakan","male","28","0","0","110564","26.55","C52","S","D","","Stockholm, Sweden / Washington, DC" -"1","0","Blackwell, Mr. Stephen Weart","male","45","0","0","113784","35.5","T","S","","","Trenton, NJ" -"1","1","Blank, Mr. Henry","male","40","0","0","112277","31","A31","C","7","","Glen Ridge, NJ" -"1","1","Bonnell, Miss. Caroline","female","30","0","0","36928","164.8667","C7","S","8","","Youngstown, OH" -"1","1","Bonnell, Miss. Elizabeth","female","58","0","0","113783","26.55","C103","S","8","","Birkdale, England Cleveland, Ohio" -"1","0","Borebank, Mr. John James","male","42","0","0","110489","26.55","D22","S","","","London / Winnipeg, MB" -"1","1","Bowen, Miss. Grace Scott","female","45","0","0","PC 17608","262.375","","C","4","","Cooperstown, NY" -"1","1","Bowerman, Miss. Elsie Edith","female","22","0","1","113505","55","E33","S","6","","St Leonards-on-Sea, England Ohio" -"1","1","Bradley, Mr. George (""George Arthur Brayton"")","male","","0","0","111427","26.55","","S","9","","Los Angeles, CA" -"1","0","Brady, Mr. John Bertram","male","41","0","0","113054","30.5","A21","S","","","Pomeroy, WA" -"1","0","Brandeis, Mr. Emil","male","48","0","0","PC 17591","50.4958","B10","C","","208","Omaha, NE" -"1","0","Brewe, Dr. Arthur Jackson","male","","0","0","112379","39.6","","C","","","Philadelphia, PA" -"1","1","Brown, Mrs. James Joseph (Margaret Tobin)","female","44","0","0","PC 17610","27.7208","B4","C","6","","Denver, CO" -"1","1","Brown, Mrs. John Murray (Caroline Lane Lamson)","female","59","2","0","11769","51.4792","C101","S","D","","Belmont, MA" -"1","1","Bucknell, Mrs. William Robert (Emma Eliza Ward)","female","60","0","0","11813","76.29170000000001","D15","C","8","","Philadelphia, PA" -"1","1","Burns, Miss. Elizabeth Margaret","female","41","0","0","16966","134.5","E40","C","3","","" -"1","0","Butt, Major. Archibald Willingham","male","45","0","0","113050","26.55","B38","S","","","Washington, DC" -"1","0","Cairns, Mr. Alexander","male","","0","0","113798","31","","S","","","" -"1","1","Calderhead, Mr. Edward Pennington","male","42","0","0","PC 17476","26.2875","E24","S","5","","New York, NY" -"1","1","Candee, Mrs. Edward (Helen Churchill Hungerford)","female","53","0","0","PC 17606","27.4458","","C","6","","Washington, DC" -"1","1","Cardeza, Mr. Thomas Drake Martinez","male","36","0","1","PC 17755","512.3292","B51 B53 B55","C","3","","Austria-Hungary / Germantown, Philadelphia, PA" -"1","1","Cardeza, Mrs. James Warburton Martinez (Charlotte Wardle Drake)","female","58","0","1","PC 17755","512.3292","B51 B53 B55","C","3","","Germantown, Philadelphia, PA" -"1","0","Carlsson, Mr. Frans Olof","male","33","0","0","695","5","B51 B53 B55","S","","","New York, NY" -"1","0","Carrau, Mr. Francisco M","male","28","0","0","113059","47.1","","S","","","Montevideo, Uruguay" -"1","0","Carrau, Mr. Jose Pedro","male","17","0","0","113059","47.1","","S","","","Montevideo, Uruguay" -"1","1","Carter, Master. William Thornton II","male","11","1","2","113760","120","B96 B98","S","4","","Bryn Mawr, PA" -"1","1","Carter, Miss. Lucile Polk","female","14","1","2","113760","120","B96 B98","S","4","","Bryn Mawr, PA" -"1","1","Carter, Mr. William Ernest","male","36","1","2","113760","120","B96 B98","S","C","","Bryn Mawr, PA" -"1","1","Carter, Mrs. William Ernest (Lucile Polk)","female","36","1","2","113760","120","B96 B98","S","4","","Bryn Mawr, PA" -"1","0","Case, Mr. Howard Brown","male","49","0","0","19924","26","","S","","","Ascot, Berkshire / Rochester, NY" -"1","1","Cassebeer, Mrs. Henry Arthur Jr (Eleanor Genevieve Fosdick)","female","","0","0","17770","27.7208","","C","5","","New York, NY" -"1","0","Cavendish, Mr. Tyrell William","male","36","1","0","19877","78.84999999999999","C46","S","","172","Little Onn Hall, Staffs" -"1","1","Cavendish, Mrs. Tyrell William (Julia Florence Siegel)","female","76","1","0","19877","78.84999999999999","C46","S","6","","Little Onn Hall, Staffs" -"1","0","Chaffee, Mr. Herbert Fuller","male","46","1","0","W.E.P. 5734","61.175","E31","S","","","Amenia, ND" -"1","1","Chaffee, Mrs. Herbert Fuller (Carrie Constance Toogood)","female","47","1","0","W.E.P. 5734","61.175","E31","S","4","","Amenia, ND" -"1","1","Chambers, Mr. Norman Campbell","male","27","1","0","113806","53.1","E8","S","5","","New York, NY / Ithaca, NY" -"1","1","Chambers, Mrs. Norman Campbell (Bertha Griggs)","female","33","1","0","113806","53.1","E8","S","5","","New York, NY / Ithaca, NY" -"1","1","Chaudanson, Miss. Victorine","female","36","0","0","PC 17608","262.375","B61","C","4","","" -"1","1","Cherry, Miss. Gladys","female","30","0","0","110152","86.5","B77","S","8","","London, England" -"1","1","Chevre, Mr. Paul Romaine","male","45","0","0","PC 17594","29.7","A9","C","7","","Paris, France" -"1","1","Chibnall, Mrs. (Edith Martha Bowerman)","female","","0","1","113505","55","E33","S","6","","St Leonards-on-Sea, England Ohio" -"1","0","Chisholm, Mr. Roderick Robert Crispin","male","","0","0","112051","0","","S","","","Liverpool, England / Belfast" -"1","0","Clark, Mr. Walter Miller","male","27","1","0","13508","136.7792","C89","C","","","Los Angeles, CA" -"1","1","Clark, Mrs. Walter Miller (Virginia McDowell)","female","26","1","0","13508","136.7792","C89","C","4","","Los Angeles, CA" -"1","1","Cleaver, Miss. Alice","female","22","0","0","113781","151.55","","S","11","","" -"1","0","Clifford, Mr. George Quincy","male","","0","0","110465","52","A14","S","","","Stoughton, MA" -"1","0","Colley, Mr. Edward Pomeroy","male","47","0","0","5727","25.5875","E58","S","","","Victoria, BC" -"1","1","Compton, Miss. Sara Rebecca","female","39","1","1","PC 17756","83.1583","E49","C","14","","Lakewood, NJ" -"1","0","Compton, Mr. Alexander Taylor Jr","male","37","1","1","PC 17756","83.1583","E52","C","","","Lakewood, NJ" -"1","1","Compton, Mrs. Alexander Taylor (Mary Eliza Ingersoll)","female","64","0","2","PC 17756","83.1583","E45","C","14","","Lakewood, NJ" -"1","1","Cornell, Mrs. Robert Clifford (Malvina Helen Lamson)","female","55","2","0","11770","25.7","C101","S","2","","New York, NY" -"1","0","Crafton, Mr. John Bertram","male","","0","0","113791","26.55","","S","","","Roachdale, IN" -"1","0","Crosby, Capt. Edward Gifford","male","70","1","1","WE/P 5735","71","B22","S","","269","Milwaukee, WI" -"1","1","Crosby, Miss. Harriet R","female","36","0","2","WE/P 5735","71","B22","S","7","","Milwaukee, WI" -"1","1","Crosby, Mrs. Edward Gifford (Catherine Elizabeth Halstead)","female","64","1","1","112901","26.55","B26","S","7","","Milwaukee, WI" -"1","0","Cumings, Mr. John Bradley","male","39","1","0","PC 17599","71.2833","C85","C","","","New York, NY" -"1","1","Cumings, Mrs. John Bradley (Florence Briggs Thayer)","female","38","1","0","PC 17599","71.2833","C85","C","4","","New York, NY" -"1","1","Daly, Mr. Peter Denis ","male","51","0","0","113055","26.55","E17","S","5 9","","Lima, Peru" -"1","1","Daniel, Mr. Robert Williams","male","27","0","0","113804","30.5","","S","3","","Philadelphia, PA" -"1","1","Daniels, Miss. Sarah","female","33","0","0","113781","151.55","","S","8","","" -"1","0","Davidson, Mr. Thornton","male","31","1","0","F.C. 12750","52","B71","S","","","Montreal, PQ" -"1","1","Davidson, Mrs. Thornton (Orian Hays)","female","27","1","2","F.C. 12750","52","B71","S","3","","Montreal, PQ" -"1","1","Dick, Mr. Albert Adrian","male","31","1","0","17474","57","B20","S","3","","Calgary, AB" -"1","1","Dick, Mrs. Albert Adrian (Vera Gillespie)","female","17","1","0","17474","57","B20","S","3","","Calgary, AB" -"1","1","Dodge, Dr. Washington","male","53","1","1","33638","81.8583","A34","S","13","","San Francisco, CA" -"1","1","Dodge, Master. Washington","male","4","0","2","33638","81.8583","A34","S","5","","San Francisco, CA" -"1","1","Dodge, Mrs. Washington (Ruth Vidaver)","female","54","1","1","33638","81.8583","A34","S","5","","San Francisco, CA" -"1","0","Douglas, Mr. Walter Donald","male","50","1","0","PC 17761","106.425","C86","C","","62","Deephaven, MN / Cedar Rapids, IA" -"1","1","Douglas, Mrs. Frederick Charles (Mary Helene Baxter)","female","27","1","1","PC 17558","247.5208","B58 B60","C","6","","Montreal, PQ" -"1","1","Douglas, Mrs. Walter Donald (Mahala Dutton)","female","48","1","0","PC 17761","106.425","C86","C","2","","Deephaven, MN / Cedar Rapids, IA" -"1","1","Duff Gordon, Lady. (Lucille Christiana Sutherland) (""Mrs Morgan"")","female","48","1","0","11755","39.6","A16","C","1","","London / Paris" -"1","1","Duff Gordon, Sir. Cosmo Edmund (""Mr Morgan"")","male","49","1","0","PC 17485","56.9292","A20","C","1","","London / Paris" -"1","0","Dulles, Mr. William Crothers","male","39","0","0","PC 17580","29.7","A18","C","","133","Philadelphia, PA" -"1","1","Earnshaw, Mrs. Boulton (Olive Potter)","female","23","0","1","11767","83.1583","C54","C","7","","Mt Airy, Philadelphia, PA" -"1","1","Endres, Miss. Caroline Louise","female","38","0","0","PC 17757","227.525","C45","C","4","","New York, NY" -"1","1","Eustis, Miss. Elizabeth Mussey","female","54","1","0","36947","78.2667","D20","C","4","","Brookline, MA" -"1","0","Evans, Miss. Edith Corse","female","36","0","0","PC 17531","31.6792","A29","C","","","New York, NY" -"1","0","Farthing, Mr. John","male","","0","0","PC 17483","221.7792","C95","S","","","" -"1","1","Flegenheim, Mrs. Alfred (Antoinette)","female","","0","0","PC 17598","31.6833","","S","7","","New York, NY" -"1","1","Fleming, Miss. Margaret","female","","0","0","17421","110.8833","","C","4","","" -"1","1","Flynn, Mr. John Irwin (""Irving"")","male","36","0","0","PC 17474","26.3875","E25","S","5","","Brooklyn, NY" -"1","0","Foreman, Mr. Benjamin Laventall","male","30","0","0","113051","27.75","C111","C","","","New York, NY" -"1","1","Fortune, Miss. Alice Elizabeth","female","24","3","2","19950","263","C23 C25 C27","S","10","","Winnipeg, MB" -"1","1","Fortune, Miss. Ethel Flora","female","28","3","2","19950","263","C23 C25 C27","S","10","","Winnipeg, MB" -"1","1","Fortune, Miss. Mabel Helen","female","23","3","2","19950","263","C23 C25 C27","S","10","","Winnipeg, MB" -"1","0","Fortune, Mr. Charles Alexander","male","19","3","2","19950","263","C23 C25 C27","S","","","Winnipeg, MB" -"1","0","Fortune, Mr. Mark","male","64","1","4","19950","263","C23 C25 C27","S","","","Winnipeg, MB" -"1","1","Fortune, Mrs. Mark (Mary McDougald)","female","60","1","4","19950","263","C23 C25 C27","S","10","","Winnipeg, MB" -"1","1","Francatelli, Miss. Laura Mabel","female","30","0","0","PC 17485","56.9292","E36","C","1","","" -"1","0","Franklin, Mr. Thomas Parham","male","","0","0","113778","26.55","D34","S","","","Westcliff-on-Sea, Essex" -"1","1","Frauenthal, Dr. Henry William","male","50","2","0","PC 17611","133.65","","S","5","","New York, NY" -"1","1","Frauenthal, Mr. Isaac Gerald","male","43","1","0","17765","27.7208","D40","C","5","","New York, NY" -"1","1","Frauenthal, Mrs. Henry William (Clara Heinsheimer)","female","","1","0","PC 17611","133.65","","S","5","","New York, NY" -"1","1","Frolicher, Miss. Hedwig Margaritha","female","22","0","2","13568","49.5","B39","C","5","","Zurich, Switzerland" -"1","1","Frolicher-Stehli, Mr. Maxmillian","male","60","1","1","13567","79.2","B41","C","5","","Zurich, Switzerland" -"1","1","Frolicher-Stehli, Mrs. Maxmillian (Margaretha Emerentia Stehli)","female","48","1","1","13567","79.2","B41","C","5","","Zurich, Switzerland" -"1","0","Fry, Mr. Richard","male","","0","0","112058","0","B102","S","","","" -"1","0","Futrelle, Mr. Jacques Heath","male","37","1","0","113803","53.1","C123","S","","","Scituate, MA" -"1","1","Futrelle, Mrs. Jacques Heath (Lily May Peel)","female","35","1","0","113803","53.1","C123","S","D","","Scituate, MA" -"1","0","Gee, Mr. Arthur H","male","47","0","0","111320","38.5","E63","S","","275","St Anne's-on-Sea, Lancashire" -"1","1","Geiger, Miss. Amalie","female","35","0","0","113503","211.5","C130","C","4","","" -"1","1","Gibson, Miss. Dorothy Winifred","female","22","0","1","112378","59.4","","C","7","","New York, NY" -"1","1","Gibson, Mrs. Leonard (Pauline C Boeson)","female","45","0","1","112378","59.4","","C","7","","New York, NY" -"1","0","Giglio, Mr. Victor","male","24","0","0","PC 17593","79.2","B86","C","","","" -"1","1","Goldenberg, Mr. Samuel L","male","49","1","0","17453","89.10420000000001","C92","C","5","","Paris, France / New York, NY" -"1","1","Goldenberg, Mrs. Samuel L (Edwiga Grabowska)","female","","1","0","17453","89.10420000000001","C92","C","5","","Paris, France / New York, NY" -"1","0","Goldschmidt, Mr. George B","male","71","0","0","PC 17754","34.6542","A5","C","","","New York, NY" -"1","1","Gracie, Col. Archibald IV","male","53","0","0","113780","28.5","C51","C","B","","Washington, DC" -"1","1","Graham, Miss. Margaret Edith","female","19","0","0","112053","30","B42","S","3","","Greenwich, CT" -"1","0","Graham, Mr. George Edward","male","38","0","1","PC 17582","153.4625","C91","S","","147","Winnipeg, MB" -"1","1","Graham, Mrs. William Thompson (Edith Junkins)","female","58","0","1","PC 17582","153.4625","C125","S","3","","Greenwich, CT" -"1","1","Greenfield, Mr. William Bertram","male","23","0","1","PC 17759","63.3583","D10 D12","C","7","","New York, NY" -"1","1","Greenfield, Mrs. Leo David (Blanche Strouse)","female","45","0","1","PC 17759","63.3583","D10 D12","C","7","","New York, NY" -"1","0","Guggenheim, Mr. Benjamin","male","46","0","0","PC 17593","79.2","B82 B84","C","","","New York, NY" -"1","1","Harder, Mr. George Achilles","male","25","1","0","11765","55.4417","E50","C","5","","Brooklyn, NY" -"1","1","Harder, Mrs. George Achilles (Dorothy Annan)","female","25","1","0","11765","55.4417","E50","C","5","","Brooklyn, NY" -"1","1","Harper, Mr. Henry Sleeper","male","48","1","0","PC 17572","76.72920000000001","D33","C","3","","New York, NY" -"1","1","Harper, Mrs. Henry Sleeper (Myna Haxtun)","female","49","1","0","PC 17572","76.72920000000001","D33","C","3","","New York, NY" -"1","0","Harrington, Mr. Charles H","male","","0","0","113796","42.4","","S","","","" -"1","0","Harris, Mr. Henry Birkhardt","male","45","1","0","36973","83.47499999999999","C83","S","","","New York, NY" -"1","1","Harris, Mrs. Henry Birkhardt (Irene Wallach)","female","35","1","0","36973","83.47499999999999","C83","S","D","","New York, NY" -"1","0","Harrison, Mr. William","male","40","0","0","112059","0","B94","S","","110","" -"1","1","Hassab, Mr. Hammad","male","27","0","0","PC 17572","76.72920000000001","D49","C","3","","" -"1","1","Hawksford, Mr. Walter James","male","","0","0","16988","30","D45","S","3","","Kingston, Surrey" -"1","1","Hays, Miss. Margaret Bechstein","female","24","0","0","11767","83.1583","C54","C","7","","New York, NY" -"1","0","Hays, Mr. Charles Melville","male","55","1","1","12749","93.5","B69","S","","307","Montreal, PQ" -"1","1","Hays, Mrs. Charles Melville (Clara Jennings Gregg)","female","52","1","1","12749","93.5","B69","S","3","","Montreal, PQ" -"1","0","Head, Mr. Christopher","male","42","0","0","113038","42.5","B11","S","","","London / Middlesex" -"1","0","Hilliard, Mr. Herbert Henry","male","","0","0","17463","51.8625","E46","S","","","Brighton, MA" -"1","0","Hipkins, Mr. William Edward","male","55","0","0","680","50","C39","S","","","London / Birmingham" -"1","1","Hippach, Miss. Jean Gertrude","female","16","0","1","111361","57.9792","B18","C","4","","Chicago, IL" -"1","1","Hippach, Mrs. Louis Albert (Ida Sophia Fischer)","female","44","0","1","111361","57.9792","B18","C","4","","Chicago, IL" -"1","1","Hogeboom, Mrs. John C (Anna Andrews)","female","51","1","0","13502","77.95829999999999","D11","S","10","","Hudson, NY" -"1","0","Holverson, Mr. Alexander Oskar","male","42","1","0","113789","52","","S","","38","New York, NY" -"1","1","Holverson, Mrs. Alexander Oskar (Mary Aline Towner)","female","35","1","0","113789","52","","S","8","","New York, NY" -"1","1","Homer, Mr. Harry (""Mr E Haven"")","male","35","0","0","111426","26.55","","C","15","","Indianapolis, IN" -"1","1","Hoyt, Mr. Frederick Maxfield","male","38","1","0","19943","90","C93","S","D","","New York, NY / Stamford CT" -"1","0","Hoyt, Mr. William Fisher","male","","0","0","PC 17600","30.6958","","C","14","","New York, NY" -"1","1","Hoyt, Mrs. Frederick Maxfield (Jane Anne Forby)","female","35","1","0","19943","90","C93","S","D","","New York, NY / Stamford CT" -"1","1","Icard, Miss. Amelie","female","38","0","0","113572","80","B28","","6","","" -"1","0","Isham, Miss. Ann Elizabeth","female","50","0","0","PC 17595","28.7125","C49","C","","","Paris, France New York, NY" -"1","1","Ismay, Mr. Joseph Bruce","male","49","0","0","112058","0","B52 B54 B56","S","C","","Liverpool" -"1","0","Jones, Mr. Charles Cresson","male","46","0","0","694","26","","S","","80","Bennington, VT" -"1","0","Julian, Mr. Henry Forbes","male","50","0","0","113044","26","E60","S","","","London" -"1","0","Keeping, Mr. Edwin","male","32.5","0","0","113503","211.5","C132","C","","45","" -"1","0","Kent, Mr. Edward Austin","male","58","0","0","11771","29.7","B37","C","","258","Buffalo, NY" -"1","0","Kenyon, Mr. Frederick R","male","41","1","0","17464","51.8625","D21","S","","","Southington / Noank, CT" -"1","1","Kenyon, Mrs. Frederick R (Marion)","female","","1","0","17464","51.8625","D21","S","8","","Southington / Noank, CT" -"1","1","Kimball, Mr. Edwin Nelson Jr","male","42","1","0","11753","52.5542","D19","S","5","","Boston, MA" -"1","1","Kimball, Mrs. Edwin Nelson Jr (Gertrude Parsons)","female","45","1","0","11753","52.5542","D19","S","5","","Boston, MA" -"1","0","Klaber, Mr. Herman","male","","0","0","113028","26.55","C124","S","","","Portland, OR" -"1","1","Kreuchen, Miss. Emilie","female","39","0","0","24160","211.3375","","S","2","","" -"1","1","Leader, Dr. Alice (Farnham)","female","49","0","0","17465","25.9292","D17","S","8","","New York, NY" -"1","1","LeRoy, Miss. Bertha","female","30","0","0","PC 17761","106.425","","C","2","","" -"1","1","Lesurer, Mr. Gustave J","male","35","0","0","PC 17755","512.3292","B101","C","3","","" -"1","0","Lewy, Mr. Ervin G","male","","0","0","PC 17612","27.7208","","C","","","Chicago, IL" -"1","0","Lindeberg-Lind, Mr. Erik Gustaf (""Mr Edward Lingrey"")","male","42","0","0","17475","26.55","","S","","","Stockholm, Sweden" -"1","1","Lindstrom, Mrs. Carl Johan (Sigrid Posse)","female","55","0","0","112377","27.7208","","C","6","","Stockholm, Sweden" -"1","1","Lines, Miss. Mary Conover","female","16","0","1","PC 17592","39.4","D28","S","9","","Paris, France" -"1","1","Lines, Mrs. Ernest H (Elizabeth Lindsey James)","female","51","0","1","PC 17592","39.4","D28","S","9","","Paris, France" -"1","0","Long, Mr. Milton Clyde","male","29","0","0","113501","30","D6","S","","126","Springfield, MA" -"1","1","Longley, Miss. Gretchen Fiske","female","21","0","0","13502","77.95829999999999","D9","S","10","","Hudson, NY" -"1","0","Loring, Mr. Joseph Holland","male","30","0","0","113801","45.5","","S","","","London / New York, NY" -"1","1","Lurette, Miss. Elise","female","58","0","0","PC 17569","146.5208","B80","C","","","" -"1","1","Madill, Miss. Georgette Alexandra","female","15","0","1","24160","211.3375","B5","S","2","","St Louis, MO" -"1","0","Maguire, Mr. John Edward","male","30","0","0","110469","26","C106","S","","","Brockton, MA" -"1","1","Maioni, Miss. Roberta","female","16","0","0","110152","86.5","B79","S","8","","" -"1","1","Marechal, Mr. Pierre","male","","0","0","11774","29.7","C47","C","7","","Paris, France" -"1","0","Marvin, Mr. Daniel Warner","male","19","1","0","113773","53.1","D30","S","","","New York, NY" -"1","1","Marvin, Mrs. Daniel Warner (Mary Graham Carmichael Farquarson)","female","18","1","0","113773","53.1","D30","S","10","","New York, NY" -"1","1","Mayne, Mlle. Berthe Antonine (""Mrs de Villiers"")","female","24","0","0","PC 17482","49.5042","C90","C","6","","Belgium Montreal, PQ" -"1","0","McCaffry, Mr. Thomas Francis","male","46","0","0","13050","75.24169999999999","C6","C","","292","Vancouver, BC" -"1","0","McCarthy, Mr. Timothy J","male","54","0","0","17463","51.8625","E46","S","","175","Dorchester, MA" -"1","1","McGough, Mr. James Robert","male","36","0","0","PC 17473","26.2875","E25","S","7","","Philadelphia, PA" -"1","0","Meyer, Mr. Edgar Joseph","male","28","1","0","PC 17604","82.1708","","C","","","New York, NY" -"1","1","Meyer, Mrs. Edgar Joseph (Leila Saks)","female","","1","0","PC 17604","82.1708","","C","6","","New York, NY" -"1","0","Millet, Mr. Francis Davis","male","65","0","0","13509","26.55","E38","S","","249","East Bridgewater, MA" -"1","0","Minahan, Dr. William Edward","male","44","2","0","19928","90","C78","Q","","230","Fond du Lac, WI" -"1","1","Minahan, Miss. Daisy E","female","33","1","0","19928","90","C78","Q","14","","Green Bay, WI" -"1","1","Minahan, Mrs. William Edward (Lillian E Thorpe)","female","37","1","0","19928","90","C78","Q","14","","Fond du Lac, WI" -"1","1","Mock, Mr. Philipp Edmund","male","30","1","0","13236","57.75","C78","C","11","","New York, NY" -"1","0","Molson, Mr. Harry Markland","male","55","0","0","113787","30.5","C30","S","","","Montreal, PQ" -"1","0","Moore, Mr. Clarence Bloomfield","male","47","0","0","113796","42.4","","S","","","Washington, DC" -"1","0","Natsch, Mr. Charles H","male","37","0","1","PC 17596","29.7","C118","C","","","Brooklyn, NY" -"1","1","Newell, Miss. Madeleine","female","31","1","0","35273","113.275","D36","C","6","","Lexington, MA" -"1","1","Newell, Miss. Marjorie","female","23","1","0","35273","113.275","D36","C","6","","Lexington, MA" -"1","0","Newell, Mr. Arthur Webster","male","58","0","2","35273","113.275","D48","C","","122","Lexington, MA" -"1","1","Newsom, Miss. Helen Monypeny","female","19","0","2","11752","26.2833","D47","S","5","","New York, NY" -"1","0","Nicholson, Mr. Arthur Ernest","male","64","0","0","693","26","","S","","263","Isle of Wight, England" -"1","1","Oliva y Ocana, Dona. Fermina","female","39","0","0","PC 17758","108.9","C105","C","8","","" -"1","1","Omont, Mr. Alfred Fernand","male","","0","0","F.C. 12998","25.7417","","C","7","","Paris, France" -"1","1","Ostby, Miss. Helene Ragnhild","female","22","0","1","113509","61.9792","B36","C","5","","Providence, RI" -"1","0","Ostby, Mr. Engelhart Cornelius","male","65","0","1","113509","61.9792","B30","C","","234","Providence, RI" -"1","0","Ovies y Rodriguez, Mr. Servando","male","28.5","0","0","PC 17562","27.7208","D43","C","","189","?Havana, Cuba" -"1","0","Parr, Mr. William Henry Marsh","male","","0","0","112052","0","","S","","","Belfast" -"1","0","Partner, Mr. Austen","male","45.5","0","0","113043","28.5","C124","S","","166","Surbiton Hill, Surrey" -"1","0","Payne, Mr. Vivian Ponsonby","male","23","0","0","12749","93.5","B24","S","","","Montreal, PQ" -"1","0","Pears, Mr. Thomas Clinton","male","29","1","0","113776","66.59999999999999","C2","S","","","Isleworth, England" -"1","1","Pears, Mrs. Thomas (Edith Wearne)","female","22","1","0","113776","66.59999999999999","C2","S","8","","Isleworth, England" -"1","0","Penasco y Castellana, Mr. Victor de Satode","male","18","1","0","PC 17758","108.9","C65","C","","","Madrid, Spain" -"1","1","Penasco y Castellana, Mrs. Victor de Satode (Maria Josefa Perez de Soto y Vallejo)","female","17","1","0","PC 17758","108.9","C65","C","8","","Madrid, Spain" -"1","1","Perreault, Miss. Anne","female","30","0","0","12749","93.5","B73","S","3","","" -"1","1","Peuchen, Major. Arthur Godfrey","male","52","0","0","113786","30.5","C104","S","6","","Toronto, ON" -"1","0","Porter, Mr. Walter Chamberlain","male","47","0","0","110465","52","C110","S","","207","Worcester, MA" -"1","1","Potter, Mrs. Thomas Jr (Lily Alexenia Wilson)","female","56","0","1","11767","83.1583","C50","C","7","","Mt Airy, Philadelphia, PA" -"1","0","Reuchlin, Jonkheer. John George","male","38","0","0","19972","0","","S","","","Rotterdam, Netherlands" -"1","1","Rheims, Mr. George Alexander Lucien","male","","0","0","PC 17607","39.6","","S","A","","Paris / New York, NY" -"1","0","Ringhini, Mr. Sante","male","22","0","0","PC 17760","135.6333","","C","","232","" -"1","0","Robbins, Mr. Victor","male","","0","0","PC 17757","227.525","","C","","","" -"1","1","Robert, Mrs. Edward Scott (Elisabeth Walton McMillan)","female","43","0","1","24160","211.3375","B3","S","2","","St Louis, MO" -"1","0","Roebling, Mr. Washington Augustus II","male","31","0","0","PC 17590","50.4958","A24","S","","","Trenton, NJ" -"1","1","Romaine, Mr. Charles Hallace (""Mr C Rolmane"")","male","45","0","0","111428","26.55","","S","9","","New York, NY" -"1","0","Rood, Mr. Hugh Roscoe","male","","0","0","113767","50","A32","S","","","Seattle, WA" -"1","1","Rosenbaum, Miss. Edith Louise","female","33","0","0","PC 17613","27.7208","A11","C","11","","Paris, France" -"1","0","Rosenshine, Mr. George (""Mr George Thorne"")","male","46","0","0","PC 17585","79.2","","C","","16","New York, NY" -"1","0","Ross, Mr. John Hugo","male","36","0","0","13049","40.125","A10","C","","","Winnipeg, MB" -"1","1","Rothes, the Countess. of (Lucy Noel Martha Dyer-Edwards)","female","33","0","0","110152","86.5","B77","S","8","","London Vancouver, BC" -"1","0","Rothschild, Mr. Martin","male","55","1","0","PC 17603","59.4","","C","","","New York, NY" -"1","1","Rothschild, Mrs. Martin (Elizabeth L. Barrett)","female","54","1","0","PC 17603","59.4","","C","6","","New York, NY" -"1","0","Rowe, Mr. Alfred G","male","33","0","0","113790","26.55","","S","","109","London" -"1","1","Ryerson, Master. John Borie","male","13","2","2","PC 17608","262.375","B57 B59 B63 B66","C","4","","Haverford, PA / Cooperstown, NY" -"1","1","Ryerson, Miss. Emily Borie","female","18","2","2","PC 17608","262.375","B57 B59 B63 B66","C","4","","Haverford, PA / Cooperstown, NY" -"1","1","Ryerson, Miss. Susan Parker ""Suzette""","female","21","2","2","PC 17608","262.375","B57 B59 B63 B66","C","4","","Haverford, PA / Cooperstown, NY" -"1","0","Ryerson, Mr. Arthur Larned","male","61","1","3","PC 17608","262.375","B57 B59 B63 B66","C","","","Haverford, PA / Cooperstown, NY" -"1","1","Ryerson, Mrs. Arthur Larned (Emily Maria Borie)","female","48","1","3","PC 17608","262.375","B57 B59 B63 B66","C","4","","Haverford, PA / Cooperstown, NY" -"1","1","Saalfeld, Mr. Adolphe","male","","0","0","19988","30.5","C106","S","3","","Manchester, England" -"1","1","Sagesser, Mlle. Emma","female","24","0","0","PC 17477","69.3","B35","C","9","","" -"1","1","Salomon, Mr. Abraham L","male","","0","0","111163","26","","S","1","","New York, NY" -"1","1","Schabert, Mrs. Paul (Emma Mock)","female","35","1","0","13236","57.75","C28","C","11","","New York, NY" -"1","1","Serepeca, Miss. Augusta","female","30","0","0","113798","31","","C","4","","" -"1","1","Seward, Mr. Frederic Kimber","male","34","0","0","113794","26.55","","S","7","","New York, NY" -"1","1","Shutes, Miss. Elizabeth W","female","40","0","0","PC 17582","153.4625","C125","S","3","","New York, NY / Greenwich CT" -"1","1","Silverthorne, Mr. Spencer Victor","male","35","0","0","PC 17475","26.2875","E24","S","5","","St Louis, MO" -"1","0","Silvey, Mr. William Baird","male","50","1","0","13507","55.9","E44","S","","","Duluth, MN" -"1","1","Silvey, Mrs. William Baird (Alice Munger)","female","39","1","0","13507","55.9","E44","S","11","","Duluth, MN" -"1","1","Simonius-Blumer, Col. Oberst Alfons","male","56","0","0","13213","35.5","A26","C","3","","Basel, Switzerland" -"1","1","Sloper, Mr. William Thompson","male","28","0","0","113788","35.5","A6","S","7","","New Britain, CT" -"1","0","Smart, Mr. John Montgomery","male","56","0","0","113792","26.55","","S","","","New York, NY" -"1","0","Smith, Mr. James Clinch","male","56","0","0","17764","30.6958","A7","C","","","St James, Long Island, NY" -"1","0","Smith, Mr. Lucien Philip","male","24","1","0","13695","60","C31","S","","","Huntington, WV" -"1","0","Smith, Mr. Richard William","male","","0","0","113056","26","A19","S","","","Streatham, Surrey" -"1","1","Smith, Mrs. Lucien Philip (Mary Eloise Hughes)","female","18","1","0","13695","60","C31","S","6","","Huntington, WV" -"1","1","Snyder, Mr. John Pillsbury","male","24","1","0","21228","82.2667","B45","S","7","","Minneapolis, MN" -"1","1","Snyder, Mrs. John Pillsbury (Nelle Stevenson)","female","23","1","0","21228","82.2667","B45","S","7","","Minneapolis, MN" -"1","1","Spedden, Master. Robert Douglas","male","6","0","2","16966","134.5","E34","C","3","","Tuxedo Park, NY" -"1","1","Spedden, Mr. Frederic Oakley","male","45","1","1","16966","134.5","E34","C","3","","Tuxedo Park, NY" -"1","1","Spedden, Mrs. Frederic Oakley (Margaretta Corning Stone)","female","40","1","1","16966","134.5","E34","C","3","","Tuxedo Park, NY" -"1","0","Spencer, Mr. William Augustus","male","57","1","0","PC 17569","146.5208","B78","C","","","Paris, France" -"1","1","Spencer, Mrs. William Augustus (Marie Eugenie)","female","","1","0","PC 17569","146.5208","B78","C","6","","Paris, France" -"1","1","Stahelin-Maeglin, Dr. Max","male","32","0","0","13214","30.5","B50","C","3","","Basel, Switzerland" -"1","0","Stead, Mr. William Thomas","male","62","0","0","113514","26.55","C87","S","","","Wimbledon Park, London / Hayling Island, Hants" -"1","1","Stengel, Mr. Charles Emil Henry","male","54","1","0","11778","55.4417","C116","C","1","","Newark, NJ" -"1","1","Stengel, Mrs. Charles Emil Henry (Annie May Morris)","female","43","1","0","11778","55.4417","C116","C","5","","Newark, NJ" -"1","1","Stephenson, Mrs. Walter Bertram (Martha Eustis)","female","52","1","0","36947","78.2667","D20","C","4","","Haverford, PA" -"1","0","Stewart, Mr. Albert A","male","","0","0","PC 17605","27.7208","","C","","","Gallipolis, Ohio / ? Paris / New York" -"1","1","Stone, Mrs. George Nelson (Martha Evelyn)","female","62","0","0","113572","80","B28","","6","","Cincinatti, OH" -"1","0","Straus, Mr. Isidor","male","67","1","0","PC 17483","221.7792","C55 C57","S","","96","New York, NY" -"1","0","Straus, Mrs. Isidor (Rosalie Ida Blun)","female","63","1","0","PC 17483","221.7792","C55 C57","S","","","New York, NY" -"1","0","Sutton, Mr. Frederick","male","61","0","0","36963","32.3208","D50","S","","46","Haddenfield, NJ" -"1","1","Swift, Mrs. Frederick Joel (Margaret Welles Barron)","female","48","0","0","17466","25.9292","D17","S","8","","Brooklyn, NY" -"1","1","Taussig, Miss. Ruth","female","18","0","2","110413","79.65000000000001","E68","S","8","","New York, NY" -"1","0","Taussig, Mr. Emil","male","52","1","1","110413","79.65000000000001","E67","S","","","New York, NY" -"1","1","Taussig, Mrs. Emil (Tillie Mandelbaum)","female","39","1","1","110413","79.65000000000001","E67","S","8","","New York, NY" -"1","1","Taylor, Mr. Elmer Zebley","male","48","1","0","19996","52","C126","S","5 7","","London / East Orange, NJ" -"1","1","Taylor, Mrs. Elmer Zebley (Juliet Cummins Wright)","female","","1","0","19996","52","C126","S","5 7","","London / East Orange, NJ" -"1","0","Thayer, Mr. John Borland","male","49","1","1","17421","110.8833","C68","C","","","Haverford, PA" -"1","1","Thayer, Mr. John Borland Jr","male","17","0","2","17421","110.8833","C70","C","B","","Haverford, PA" -"1","1","Thayer, Mrs. John Borland (Marian Longstreth Morris)","female","39","1","1","17421","110.8833","C68","C","4","","Haverford, PA" -"1","1","Thorne, Mrs. Gertrude Maybelle","female","","0","0","PC 17585","79.2","","C","D","","New York, NY" -"1","1","Tucker, Mr. Gilbert Milligan Jr","male","31","0","0","2543","28.5375","C53","C","7","","Albany, NY" -"1","0","Uruchurtu, Don. Manuel E","male","40","0","0","PC 17601","27.7208","","C","","","Mexico City, Mexico" -"1","0","Van der hoef, Mr. Wyckoff","male","61","0","0","111240","33.5","B19","S","","245","Brooklyn, NY" -"1","0","Walker, Mr. William Anderson","male","47","0","0","36967","34.0208","D46","S","","","East Orange, NJ" -"1","1","Ward, Miss. Anna","female","35","0","0","PC 17755","512.3292","","C","3","","" -"1","0","Warren, Mr. Frank Manley","male","64","1","0","110813","75.25","D37","C","","","Portland, OR" -"1","1","Warren, Mrs. Frank Manley (Anna Sophia Atkinson)","female","60","1","0","110813","75.25","D37","C","5","","Portland, OR" -"1","0","Weir, Col. John","male","60","0","0","113800","26.55","","S","","","England Salt Lake City, Utah" -"1","0","White, Mr. Percival Wayland","male","54","0","1","35281","77.28749999999999","D26","S","","","Brunswick, ME" -"1","0","White, Mr. Richard Frasar","male","21","0","1","35281","77.28749999999999","D26","S","","169","Brunswick, ME" -"1","1","White, Mrs. John Stuart (Ella Holmes)","female","55","0","0","PC 17760","135.6333","C32","C","8","","New York, NY / Briarcliff Manor NY" -"1","1","Wick, Miss. Mary Natalie","female","31","0","2","36928","164.8667","C7","S","8","","Youngstown, OH" -"1","0","Wick, Mr. George Dennick","male","57","1","1","36928","164.8667","","S","","","Youngstown, OH" -"1","1","Wick, Mrs. George Dennick (Mary Hitchcock)","female","45","1","1","36928","164.8667","","S","8","","Youngstown, OH" -"1","0","Widener, Mr. George Dunton","male","50","1","1","113503","211.5","C80","C","","","Elkins Park, PA" -"1","0","Widener, Mr. Harry Elkins","male","27","0","2","113503","211.5","C82","C","","","Elkins Park, PA" -"1","1","Widener, Mrs. George Dunton (Eleanor Elkins)","female","50","1","1","113503","211.5","C80","C","4","","Elkins Park, PA" -"1","1","Willard, Miss. Constance","female","21","0","0","113795","26.55","","S","8 10","","Duluth, MN" -"1","0","Williams, Mr. Charles Duane","male","51","0","1","PC 17597","61.3792","","C","","","Geneva, Switzerland / Radnor, PA" -"1","1","Williams, Mr. Richard Norris II","male","21","0","1","PC 17597","61.3792","","C","A","","Geneva, Switzerland / Radnor, PA" -"1","0","Williams-Lambert, Mr. Fletcher Fellows","male","","0","0","113510","35","C128","S","","","London, England" -"1","1","Wilson, Miss. Helen Alice","female","31","0","0","16966","134.5","E39 E41","C","3","","" -"1","1","Woolner, Mr. Hugh","male","","0","0","19947","35.5","C52","S","D","","London, England" -"1","0","Wright, Mr. George","male","62","0","0","113807","26.55","","S","","","Halifax, NS" -"1","1","Young, Miss. Marie Grice","female","36","0","0","PC 17760","135.6333","C32","C","8","","New York, NY / Washington, DC" -"2","0","Abelson, Mr. Samuel","male","30","1","0","P/PP 3381","24","","C","","","Russia New York, NY" -"2","1","Abelson, Mrs. Samuel (Hannah Wizosky)","female","28","1","0","P/PP 3381","24","","C","10","","Russia New York, NY" -"2","0","Aldworth, Mr. Charles Augustus","male","30","0","0","248744","13","","S","","","Bryn Mawr, PA, USA" -"2","0","Andrew, Mr. Edgardo Samuel","male","18","0","0","231945","11.5","","S","","","Buenos Aires, Argentina / New Jersey, NJ" -"2","0","Andrew, Mr. Frank Thomas","male","25","0","0","C.A. 34050","10.5","","S","","","Cornwall, England Houghton, MI" -"2","0","Angle, Mr. William A","male","34","1","0","226875","26","","S","","","Warwick, England" -"2","1","Angle, Mrs. William A (Florence ""Mary"" Agnes Hughes)","female","36","1","0","226875","26","","S","11","","Warwick, England" -"2","0","Ashby, Mr. John","male","57","0","0","244346","13","","S","","","West Hoboken, NJ" -"2","0","Bailey, Mr. Percy Andrew","male","18","0","0","29108","11.5","","S","","","Penzance, Cornwall / Akron, OH" -"2","0","Baimbrigge, Mr. Charles Robert","male","23","0","0","C.A. 31030","10.5","","S","","","Guernsey" -"2","1","Ball, Mrs. (Ada E Hall)","female","36","0","0","28551","13","D","S","10","","Bristol, Avon / Jacksonville, FL" -"2","0","Banfield, Mr. Frederick James","male","28","0","0","C.A./SOTON 34068","10.5","","S","","","Plymouth, Dorset / Houghton, MI" -"2","0","Bateman, Rev. Robert James","male","51","0","0","S.O.P. 1166","12.525","","S","","174","Jacksonville, FL" -"2","1","Beane, Mr. Edward","male","32","1","0","2908","26","","S","13","","Norwich / New York, NY" -"2","1","Beane, Mrs. Edward (Ethel Clarke)","female","19","1","0","2908","26","","S","13","","Norwich / New York, NY" -"2","0","Beauchamp, Mr. Henry James","male","28","0","0","244358","26","","S","","","England" -"2","1","Becker, Master. Richard F","male","1","2","1","230136","39","F4","S","11","","Guntur, India / Benton Harbour, MI" -"2","1","Becker, Miss. Marion Louise","female","4","2","1","230136","39","F4","S","11","","Guntur, India / Benton Harbour, MI" -"2","1","Becker, Miss. Ruth Elizabeth","female","12","2","1","230136","39","F4","S","13","","Guntur, India / Benton Harbour, MI" -"2","1","Becker, Mrs. Allen Oliver (Nellie E Baumgardner)","female","36","0","3","230136","39","F4","S","11","","Guntur, India / Benton Harbour, MI" -"2","1","Beesley, Mr. Lawrence","male","34","0","0","248698","13","D56","S","13","","London" -"2","1","Bentham, Miss. Lilian W","female","19","0","0","28404","13","","S","12","","Rochester, NY" -"2","0","Berriman, Mr. William John","male","23","0","0","28425","13","","S","","","St Ives, Cornwall / Calumet, MI" -"2","0","Botsford, Mr. William Hull","male","26","0","0","237670","13","","S","","","Elmira, NY / Orange, NJ" -"2","0","Bowenur, Mr. Solomon","male","42","0","0","211535","13","","S","","","London" -"2","0","Bracken, Mr. James H","male","27","0","0","220367","13","","S","","","Lake Arthur, Chavez County, NM" -"2","1","Brown, Miss. Amelia ""Mildred""","female","24","0","0","248733","13","F33","S","11","","London / Montreal, PQ" -"2","1","Brown, Miss. Edith Eileen","female","15","0","2","29750","39","","S","14","","Cape Town, South Africa / Seattle, WA" -"2","0","Brown, Mr. Thomas William Solomon","male","60","1","1","29750","39","","S","","","Cape Town, South Africa / Seattle, WA" -"2","1","Brown, Mrs. Thomas William Solomon (Elizabeth Catherine Ford)","female","40","1","1","29750","39","","S","14","","Cape Town, South Africa / Seattle, WA" -"2","1","Bryhl, Miss. Dagmar Jenny Ingeborg ","female","20","1","0","236853","26","","S","12","","Skara, Sweden / Rockford, IL" -"2","0","Bryhl, Mr. Kurt Arnold Gottfrid","male","25","1","0","236853","26","","S","","","Skara, Sweden / Rockford, IL" -"2","1","Buss, Miss. Kate","female","36","0","0","27849","13","","S","9","","Sittingbourne, England / San Diego, CA" -"2","0","Butler, Mr. Reginald Fenton","male","25","0","0","234686","13","","S","","97","Southsea, Hants" -"2","0","Byles, Rev. Thomas Roussel Davids","male","42","0","0","244310","13","","S","","","London" -"2","1","Bystrom, Mrs. (Karolina)","female","42","0","0","236852","13","","S","","","New York, NY" -"2","1","Caldwell, Master. Alden Gates","male","0.8333","0","2","248738","29","","S","13","","Bangkok, Thailand / Roseville, IL" -"2","1","Caldwell, Mr. Albert Francis","male","26","1","1","248738","29","","S","13","","Bangkok, Thailand / Roseville, IL" -"2","1","Caldwell, Mrs. Albert Francis (Sylvia Mae Harbaugh)","female","22","1","1","248738","29","","S","13","","Bangkok, Thailand / Roseville, IL" -"2","1","Cameron, Miss. Clear Annie","female","35","0","0","F.C.C. 13528","21","","S","14","","Mamaroneck, NY" -"2","0","Campbell, Mr. William","male","","0","0","239853","0","","S","","","Belfast" -"2","0","Carbines, Mr. William","male","19","0","0","28424","13","","S","","18","St Ives, Cornwall / Calumet, MI" -"2","0","Carter, Mrs. Ernest Courtenay (Lilian Hughes)","female","44","1","0","244252","26","","S","","","London" -"2","0","Carter, Rev. Ernest Courtenay","male","54","1","0","244252","26","","S","","","London" -"2","0","Chapman, Mr. Charles Henry","male","52","0","0","248731","13.5","","S","","130","Bronx, NY" -"2","0","Chapman, Mr. John Henry","male","37","1","0","SC/AH 29037","26","","S","","17","Cornwall / Spokane, WA" -"2","0","Chapman, Mrs. John Henry (Sara Elizabeth Lawry)","female","29","1","0","SC/AH 29037","26","","S","","","Cornwall / Spokane, WA" -"2","1","Christy, Miss. Julie Rachel","female","25","1","1","237789","30","","S","12","","London" -"2","1","Christy, Mrs. (Alice Frances)","female","45","0","2","237789","30","","S","12","","London" -"2","0","Clarke, Mr. Charles Valentine","male","29","1","0","2003","26","","S","","","England / San Francisco, CA" -"2","1","Clarke, Mrs. Charles V (Ada Maria Winfield)","female","28","1","0","2003","26","","S","14","","England / San Francisco, CA" -"2","0","Coleridge, Mr. Reginald Charles","male","29","0","0","W./C. 14263","10.5","","S","","","Hartford, Huntingdonshire" -"2","0","Collander, Mr. Erik Gustaf","male","28","0","0","248740","13","","S","","","Helsinki, Finland Ashtabula, Ohio" -"2","1","Collett, Mr. Sidney C Stuart","male","24","0","0","28034","10.5","","S","9","","London / Fort Byron, NY" -"2","1","Collyer, Miss. Marjorie ""Lottie""","female","8","0","2","C.A. 31921","26.25","","S","14","","Bishopstoke, Hants / Fayette Valley, ID" -"2","0","Collyer, Mr. Harvey","male","31","1","1","C.A. 31921","26.25","","S","","","Bishopstoke, Hants / Fayette Valley, ID" -"2","1","Collyer, Mrs. Harvey (Charlotte Annie Tate)","female","31","1","1","C.A. 31921","26.25","","S","14","","Bishopstoke, Hants / Fayette Valley, ID" -"2","1","Cook, Mrs. (Selena Rogers)","female","22","0","0","W./C. 14266","10.5","F33","S","14","","Pennsylvania" -"2","0","Corbett, Mrs. Walter H (Irene Colvin)","female","30","0","0","237249","13","","S","","","Provo, UT" -"2","0","Corey, Mrs. Percy C (Mary Phyllis Elizabeth Miller)","female","","0","0","F.C.C. 13534","21","","S","","","Upper Burma, India Pittsburgh, PA" -"2","0","Cotterill, Mr. Henry ""Harry""","male","21","0","0","29107","11.5","","S","","","Penzance, Cornwall / Akron, OH" -"2","0","Cunningham, Mr. Alfred Fleming","male","","0","0","239853","0","","S","","","Belfast" -"2","1","Davies, Master. John Morgan Jr","male","8","1","1","C.A. 33112","36.75","","S","14","","St Ives, Cornwall / Hancock, MI" -"2","0","Davies, Mr. Charles Henry","male","18","0","0","S.O.C. 14879","73.5","","S","","","Lyndhurst, England" -"2","1","Davies, Mrs. John Morgan (Elizabeth Agnes Mary White) ","female","48","0","2","C.A. 33112","36.75","","S","14","","St Ives, Cornwall / Hancock, MI" -"2","1","Davis, Miss. Mary","female","28","0","0","237668","13","","S","13","","London / Staten Island, NY" -"2","0","de Brito, Mr. Jose Joaquim","male","32","0","0","244360","13","","S","","","Portugal / Sau Paulo, Brazil" -"2","0","Deacon, Mr. Percy William","male","17","0","0","S.O.C. 14879","73.5","","S","","","" -"2","0","del Carlo, Mr. Sebastiano","male","29","1","0","SC/PARIS 2167","27.7208","","C","","295","Lucca, Italy / California" -"2","1","del Carlo, Mrs. Sebastiano (Argenia Genovesi)","female","24","1","0","SC/PARIS 2167","27.7208","","C","12","","Lucca, Italy / California" -"2","0","Denbury, Mr. Herbert","male","25","0","0","C.A. 31029","31.5","","S","","","Guernsey / Elizabeth, NJ" -"2","0","Dibden, Mr. William","male","18","0","0","S.O.C. 14879","73.5","","S","","","New Forest, England" -"2","1","Doling, Miss. Elsie","female","18","0","1","231919","23","","S","","","Southampton" -"2","1","Doling, Mrs. John T (Ada Julia Bone)","female","34","0","1","231919","23","","S","","","Southampton" -"2","0","Downton, Mr. William James","male","54","0","0","28403","26","","S","","","Holley, NY" -"2","1","Drew, Master. Marshall Brines","male","8","0","2","28220","32.5","","S","10","","Greenport, NY" -"2","0","Drew, Mr. James Vivian","male","42","1","1","28220","32.5","","S","","","Greenport, NY" -"2","1","Drew, Mrs. James Vivian (Lulu Thorne Christian)","female","34","1","1","28220","32.5","","S","10","","Greenport, NY" -"2","1","Duran y More, Miss. Asuncion","female","27","1","0","SC/PARIS 2149","13.8583","","C","12","","Barcelona, Spain / Havana, Cuba" -"2","1","Duran y More, Miss. Florentina","female","30","1","0","SC/PARIS 2148","13.8583","","C","12","","Barcelona, Spain / Havana, Cuba" -"2","0","Eitemiller, Mr. George Floyd","male","23","0","0","29751","13","","S","","","England / Detroit, MI" -"2","0","Enander, Mr. Ingvar","male","21","0","0","236854","13","","S","","","Goteborg, Sweden / Rockford, IL" -"2","0","Fahlstrom, Mr. Arne Jonas","male","18","0","0","236171","13","","S","","","Oslo, Norway Bayonne, NJ" -"2","0","Faunthorpe, Mr. Harry","male","40","1","0","2926","26","","S","","286","England / Philadelphia, PA" -"2","1","Faunthorpe, Mrs. Lizzie (Elizabeth Anne Wilkinson)","female","29","1","0","2926","26","","S","16","","" -"2","0","Fillbrook, Mr. Joseph Charles","male","18","0","0","C.A. 15185","10.5","","S","","","Cornwall / Houghton, MI" -"2","0","Fox, Mr. Stanley Hubert","male","36","0","0","229236","13","","S","","236","Rochester, NY" -"2","0","Frost, Mr. Anthony Wood ""Archie""","male","","0","0","239854","0","","S","","","Belfast" -"2","0","Funk, Miss. Annie Clemmer","female","38","0","0","237671","13","","S","","","Janjgir, India / Pennsylvania" -"2","0","Fynney, Mr. Joseph J","male","35","0","0","239865","26","","S","","322","Liverpool / Montreal, PQ" -"2","0","Gale, Mr. Harry","male","38","1","0","28664","21","","S","","","Cornwall / Clear Creek, CO" -"2","0","Gale, Mr. Shadrach","male","34","1","0","28664","21","","S","","","Cornwall / Clear Creek, CO" -"2","1","Garside, Miss. Ethel","female","34","0","0","243880","13","","S","12","","Brooklyn, NY" -"2","0","Gaskell, Mr. Alfred","male","16","0","0","239865","26","","S","","","Liverpool / Montreal, PQ" -"2","0","Gavey, Mr. Lawrence","male","26","0","0","31028","10.5","","S","","","Guernsey / Elizabeth, NJ" -"2","0","Gilbert, Mr. William","male","47","0","0","C.A. 30769","10.5","","S","","","Cornwall" -"2","0","Giles, Mr. Edgar","male","21","1","0","28133","11.5","","S","","","Cornwall / Camden, NJ" -"2","0","Giles, Mr. Frederick Edward","male","21","1","0","28134","11.5","","S","","","Cornwall / Camden, NJ" -"2","0","Giles, Mr. Ralph","male","24","0","0","248726","13.5","","S","","297","West Kensington, London" -"2","0","Gill, Mr. John William","male","24","0","0","233866","13","","S","","155","Clevedon, England" -"2","0","Gillespie, Mr. William Henry","male","34","0","0","12233","13","","S","","","Vancouver, BC" -"2","0","Givard, Mr. Hans Kristensen","male","30","0","0","250646","13","","S","","305","" -"2","0","Greenberg, Mr. Samuel","male","52","0","0","250647","13","","S","","19","Bronx, NY" -"2","0","Hale, Mr. Reginald","male","30","0","0","250653","13","","S","","75","Auburn, NY" -"2","1","Hamalainen, Master. Viljo","male","0.6667","1","1","250649","14.5","","S","4","","Detroit, MI" -"2","1","Hamalainen, Mrs. William (Anna)","female","24","0","2","250649","14.5","","S","4","","Detroit, MI" -"2","0","Harbeck, Mr. William H","male","44","0","0","248746","13","","S","","35","Seattle, WA / Toledo, OH" -"2","1","Harper, Miss. Annie Jessie ""Nina""","female","6","0","1","248727","33","","S","11","","Denmark Hill, Surrey / Chicago" -"2","0","Harper, Rev. John","male","28","0","1","248727","33","","S","","","Denmark Hill, Surrey / Chicago" -"2","1","Harris, Mr. George","male","62","0","0","S.W./PP 752","10.5","","S","15","","London" -"2","0","Harris, Mr. Walter","male","30","0","0","W/C 14208","10.5","","S","","","Walthamstow, England" -"2","1","Hart, Miss. Eva Miriam","female","7","0","2","F.C.C. 13529","26.25","","S","14","","Ilford, Essex / Winnipeg, MB" -"2","0","Hart, Mr. Benjamin","male","43","1","1","F.C.C. 13529","26.25","","S","","","Ilford, Essex / Winnipeg, MB" -"2","1","Hart, Mrs. Benjamin (Esther Ada Bloomfield)","female","45","1","1","F.C.C. 13529","26.25","","S","14","","Ilford, Essex / Winnipeg, MB" -"2","1","Herman, Miss. Alice","female","24","1","2","220845","65","","S","9","","Somerset / Bernardsville, NJ" -"2","1","Herman, Miss. Kate","female","24","1","2","220845","65","","S","9","","Somerset / Bernardsville, NJ" -"2","0","Herman, Mr. Samuel","male","49","1","2","220845","65","","S","","","Somerset / Bernardsville, NJ" -"2","1","Herman, Mrs. Samuel (Jane Laver)","female","48","1","2","220845","65","","S","9","","Somerset / Bernardsville, NJ" -"2","1","Hewlett, Mrs. (Mary D Kingcome) ","female","55","0","0","248706","16","","S","13","","India / Rapid City, SD" -"2","0","Hickman, Mr. Leonard Mark","male","24","2","0","S.O.C. 14879","73.5","","S","","","West Hampstead, London / Neepawa, MB" -"2","0","Hickman, Mr. Lewis","male","32","2","0","S.O.C. 14879","73.5","","S","","256","West Hampstead, London / Neepawa, MB" -"2","0","Hickman, Mr. Stanley George","male","21","2","0","S.O.C. 14879","73.5","","S","","","West Hampstead, London / Neepawa, MB" -"2","0","Hiltunen, Miss. Marta","female","18","1","1","250650","13","","S","","","Kontiolahti, Finland / Detroit, MI" -"2","1","Hocking, Miss. Ellen ""Nellie""","female","20","2","1","29105","23","","S","4","","Cornwall / Akron, OH" -"2","0","Hocking, Mr. Richard George","male","23","2","1","29104","11.5","","S","","","Cornwall / Akron, OH" -"2","0","Hocking, Mr. Samuel James Metcalfe","male","36","0","0","242963","13","","S","","","Devonport, England" -"2","1","Hocking, Mrs. Elizabeth (Eliza Needs)","female","54","1","3","29105","23","","S","4","","Cornwall / Akron, OH" -"2","0","Hodges, Mr. Henry Price","male","50","0","0","250643","13","","S","","149","Southampton" -"2","0","Hold, Mr. Stephen","male","44","1","0","26707","26","","S","","","England / Sacramento, CA" -"2","1","Hold, Mrs. Stephen (Annie Margaret Hill)","female","29","1","0","26707","26","","S","10","","England / Sacramento, CA" -"2","0","Hood, Mr. Ambrose Jr","male","21","0","0","S.O.C. 14879","73.5","","S","","","New Forest, England" -"2","1","Hosono, Mr. Masabumi","male","42","0","0","237798","13","","S","10","","Tokyo, Japan" -"2","0","Howard, Mr. Benjamin","male","63","1","0","24065","26","","S","","","Swindon, England" -"2","0","Howard, Mrs. Benjamin (Ellen Truelove Arman)","female","60","1","0","24065","26","","S","","","Swindon, England" -"2","0","Hunt, Mr. George Henry","male","33","0","0","SCO/W 1585","12.275","","S","","","Philadelphia, PA" -"2","1","Ilett, Miss. Bertha","female","17","0","0","SO/C 14885","10.5","","S","","","Guernsey" -"2","0","Jacobsohn, Mr. Sidney Samuel","male","42","1","0","243847","27","","S","","","London" -"2","1","Jacobsohn, Mrs. Sidney Samuel (Amy Frances Christy)","female","24","2","1","243847","27","","S","12","","London" -"2","0","Jarvis, Mr. John Denzil","male","47","0","0","237565","15","","S","","","North Evington, England" -"2","0","Jefferys, Mr. Clifford Thomas","male","24","2","0","C.A. 31029","31.5","","S","","","Guernsey / Elizabeth, NJ" -"2","0","Jefferys, Mr. Ernest Wilfred","male","22","2","0","C.A. 31029","31.5","","S","","","Guernsey / Elizabeth, NJ" -"2","0","Jenkin, Mr. Stephen Curnow","male","32","0","0","C.A. 33111","10.5","","S","","","St Ives, Cornwall / Houghton, MI" -"2","1","Jerwan, Mrs. Amin S (Marie Marthe Thuillard)","female","23","0","0","SC/AH Basle 541","13.7917","D","C","11","","New York, NY" -"2","0","Kantor, Mr. Sinai","male","34","1","0","244367","26","","S","","283","Moscow / Bronx, NY" -"2","1","Kantor, Mrs. Sinai (Miriam Sternin)","female","24","1","0","244367","26","","S","12","","Moscow / Bronx, NY" -"2","0","Karnes, Mrs. J Frank (Claire Bennett)","female","22","0","0","F.C.C. 13534","21","","S","","","India / Pittsburgh, PA" -"2","1","Keane, Miss. Nora A","female","","0","0","226593","12.35","E101","Q","10","","Harrisburg, PA" -"2","0","Keane, Mr. Daniel","male","35","0","0","233734","12.35","","Q","","","" -"2","1","Kelly, Mrs. Florence ""Fannie""","female","45","0","0","223596","13.5","","S","9","","London / New York, NY" -"2","0","Kirkland, Rev. Charles Leonard","male","57","0","0","219533","12.35","","Q","","","Glasgow / Bangor, ME" -"2","0","Knight, Mr. Robert J","male","","0","0","239855","0","","S","","","Belfast" -"2","0","Kvillner, Mr. Johan Henrik Johannesson","male","31","0","0","C.A. 18723","10.5","","S","","165","Sweden / Arlington, NJ" -"2","0","Lahtinen, Mrs. William (Anna Sylfven)","female","26","1","1","250651","26","","S","","","Minneapolis, MN" -"2","0","Lahtinen, Rev. William","male","30","1","1","250651","26","","S","","","Minneapolis, MN" -"2","0","Lamb, Mr. John Joseph","male","","0","0","240261","10.7083","","Q","","","" -"2","1","Laroche, Miss. Louise","female","1","1","2","SC/Paris 2123","41.5792","","C","14","","Paris / Haiti" -"2","1","Laroche, Miss. Simonne Marie Anne Andree","female","3","1","2","SC/Paris 2123","41.5792","","C","14","","Paris / Haiti" -"2","0","Laroche, Mr. Joseph Philippe Lemercier","male","25","1","2","SC/Paris 2123","41.5792","","C","","","Paris / Haiti" -"2","1","Laroche, Mrs. Joseph (Juliette Marie Louise Lafargue)","female","22","1","2","SC/Paris 2123","41.5792","","C","14","","Paris / Haiti" -"2","1","Lehmann, Miss. Bertha","female","17","0","0","SC 1748","12","","C","12","","Berne, Switzerland / Central City, IA" -"2","1","Leitch, Miss. Jessie Wills","female","","0","0","248727","33","","S","11","","London / Chicago, IL" -"2","1","Lemore, Mrs. (Amelia Milley)","female","34","0","0","C.A. 34260","10.5","F33","S","14","","Chicago, IL" -"2","0","Levy, Mr. Rene Jacques","male","36","0","0","SC/Paris 2163","12.875","D","C","","","Montreal, PQ" -"2","0","Leyson, Mr. Robert William Norman","male","24","0","0","C.A. 29566","10.5","","S","","108","" -"2","0","Lingane, Mr. John","male","61","0","0","235509","12.35","","Q","","","" -"2","0","Louch, Mr. Charles Alexander","male","50","1","0","SC/AH 3085","26","","S","","121","Weston-Super-Mare, Somerset" -"2","1","Louch, Mrs. Charles Alexander (Alice Adelaide Slow)","female","42","1","0","SC/AH 3085","26","","S","","","Weston-Super-Mare, Somerset" -"2","0","Mack, Mrs. (Mary)","female","57","0","0","S.O./P.P. 3","10.5","E77","S","","52","Southampton / New York, NY" -"2","0","Malachard, Mr. Noel","male","","0","0","237735","15.0458","D","C","","","Paris" -"2","1","Mallet, Master. Andre","male","1","0","2","S.C./PARIS 2079","37.0042","","C","10","","Paris / Montreal, PQ" -"2","0","Mallet, Mr. Albert","male","31","1","1","S.C./PARIS 2079","37.0042","","C","","","Paris / Montreal, PQ" -"2","1","Mallet, Mrs. Albert (Antoinette Magnin)","female","24","1","1","S.C./PARIS 2079","37.0042","","C","10","","Paris / Montreal, PQ" -"2","0","Mangiavacchi, Mr. Serafino Emilio","male","","0","0","SC/A.3 2861","15.5792","","C","","","New York, NY" -"2","0","Matthews, Mr. William John","male","30","0","0","28228","13","","S","","","St Austall, Cornwall" -"2","0","Maybery, Mr. Frank Hubert","male","40","0","0","239059","16","","S","","","Weston-Super-Mare / Moose Jaw, SK" -"2","0","McCrae, Mr. Arthur Gordon","male","32","0","0","237216","13.5","","S","","209","Sydney, Australia" -"2","0","McCrie, Mr. James Matthew","male","30","0","0","233478","13","","S","","","Sarnia, ON" -"2","0","McKane, Mr. Peter David","male","46","0","0","28403","26","","S","","","Rochester, NY" -"2","1","Mellinger, Miss. Madeleine Violet","female","13","0","1","250644","19.5","","S","14","","England / Bennington, VT" -"2","1","Mellinger, Mrs. (Elizabeth Anne Maidment)","female","41","0","1","250644","19.5","","S","14","","England / Bennington, VT" -"2","1","Mellors, Mr. William John","male","19","0","0","SW/PP 751","10.5","","S","B","","Chelsea, London" -"2","0","Meyer, Mr. August","male","39","0","0","248723","13","","S","","","Harrow-on-the-Hill, Middlesex" -"2","0","Milling, Mr. Jacob Christian","male","48","0","0","234360","13","","S","","271","Copenhagen, Denmark" -"2","0","Mitchell, Mr. Henry Michael","male","70","0","0","C.A. 24580","10.5","","S","","","Guernsey / Montclair, NJ and/or Toledo, Ohio" -"2","0","Montvila, Rev. Juozas","male","27","0","0","211536","13","","S","","","Worcester, MA" -"2","0","Moraweck, Dr. Ernest","male","54","0","0","29011","14","","S","","","Frankfort, KY" -"2","0","Morley, Mr. Henry Samuel (""Mr Henry Marshall"")","male","39","0","0","250655","26","","S","","","" -"2","0","Mudd, Mr. Thomas Charles","male","16","0","0","S.O./P.P. 3","10.5","","S","","","Halesworth, England" -"2","0","Myles, Mr. Thomas Francis","male","62","0","0","240276","9.6875","","Q","","","Cambridge, MA" -"2","0","Nasser, Mr. Nicholas","male","32.5","1","0","237736","30.0708","","C","","43","New York, NY" -"2","1","Nasser, Mrs. Nicholas (Adele Achem)","female","14","1","0","237736","30.0708","","C","","","New York, NY" -"2","1","Navratil, Master. Edmond Roger","male","2","1","1","230080","26","F2","S","D","","Nice, France" -"2","1","Navratil, Master. Michel M","male","3","1","1","230080","26","F2","S","D","","Nice, France" -"2","0","Navratil, Mr. Michel (""Louis M Hoffman"")","male","36.5","0","2","230080","26","F2","S","","15","Nice, France" -"2","0","Nesson, Mr. Israel","male","26","0","0","244368","13","F2","S","","","Boston, MA" -"2","0","Nicholls, Mr. Joseph Charles","male","19","1","1","C.A. 33112","36.75","","S","","101","Cornwall / Hancock, MI" -"2","0","Norman, Mr. Robert Douglas","male","28","0","0","218629","13.5","","S","","287","Glasgow" -"2","1","Nourney, Mr. Alfred (""Baron von Drachstedt"")","male","20","0","0","SC/PARIS 2166","13.8625","D38","C","7","","Cologne, Germany" -"2","1","Nye, Mrs. (Elizabeth Ramell)","female","29","0","0","C.A. 29395","10.5","F33","S","11","","Folkstone, Kent / New York, NY" -"2","0","Otter, Mr. Richard","male","39","0","0","28213","13","","S","","","Middleburg Heights, OH" -"2","1","Oxenham, Mr. Percy Thomas","male","22","0","0","W./C. 14260","10.5","","S","13","","Pondersend, England / New Durham, NJ" -"2","1","Padro y Manent, Mr. Julian","male","","0","0","SC/PARIS 2146","13.8625","","C","9","","Spain / Havana, Cuba" -"2","0","Pain, Dr. Alfred","male","23","0","0","244278","10.5","","S","","","Hamilton, ON" -"2","1","Pallas y Castello, Mr. Emilio","male","29","0","0","SC/PARIS 2147","13.8583","","C","9","","Spain / Havana, Cuba" -"2","0","Parker, Mr. Clifford Richard","male","28","0","0","SC 14888","10.5","","S","","","St Andrews, Guernsey" -"2","0","Parkes, Mr. Francis ""Frank""","male","","0","0","239853","0","","S","","","Belfast" -"2","1","Parrish, Mrs. (Lutie Davis)","female","50","0","1","230433","26","","S","12","","Woodford County, KY" -"2","0","Pengelly, Mr. Frederick William","male","19","0","0","28665","10.5","","S","","","Gunnislake, England / Butte, MT" -"2","0","Pernot, Mr. Rene","male","","0","0","SC/PARIS 2131","15.05","","C","","","" -"2","0","Peruschitz, Rev. Joseph Maria","male","41","0","0","237393","13","","S","","","" -"2","1","Phillips, Miss. Alice Frances Louisa","female","21","0","1","S.O./P.P. 2","21","","S","12","","Ilfracombe, Devon" -"2","1","Phillips, Miss. Kate Florence (""Mrs Kate Louise Phillips Marshall"")","female","19","0","0","250655","26","","S","11","","Worcester, England" -"2","0","Phillips, Mr. Escott Robert","male","43","0","1","S.O./P.P. 2","21","","S","","","Ilfracombe, Devon" -"2","1","Pinsky, Mrs. (Rosa)","female","32","0","0","234604","13","","S","9","","Russia" -"2","0","Ponesell, Mr. Martin","male","34","0","0","250647","13","","S","","","Denmark / New York, NY" -"2","1","Portaluppi, Mr. Emilio Ilario Giuseppe","male","30","0","0","C.A. 34644","12.7375","","C","14","","Milford, NH" -"2","0","Pulbaum, Mr. Franz","male","27","0","0","SC/PARIS 2168","15.0333","","C","","","Paris" -"2","1","Quick, Miss. Phyllis May","female","2","1","1","26360","26","","S","11","","Plymouth, Devon / Detroit, MI" -"2","1","Quick, Miss. Winifred Vera","female","8","1","1","26360","26","","S","11","","Plymouth, Devon / Detroit, MI" -"2","1","Quick, Mrs. Frederick Charles (Jane Richards)","female","33","0","2","26360","26","","S","11","","Plymouth, Devon / Detroit, MI" -"2","0","Reeves, Mr. David","male","36","0","0","C.A. 17248","10.5","","S","","","Brighton, Sussex" -"2","0","Renouf, Mr. Peter Henry","male","34","1","0","31027","21","","S","12","","Elizabeth, NJ" -"2","1","Renouf, Mrs. Peter Henry (Lillian Jefferys)","female","30","3","0","31027","21","","S","","","Elizabeth, NJ" -"2","1","Reynaldo, Ms. Encarnacion","female","28","0","0","230434","13","","S","9","","Spain" -"2","0","Richard, Mr. Emile","male","23","0","0","SC/PARIS 2133","15.0458","","C","","","Paris / Montreal, PQ" -"2","1","Richards, Master. George Sibley","male","0.8333","1","1","29106","18.75","","S","4","","Cornwall / Akron, OH" -"2","1","Richards, Master. William Rowe","male","3","1","1","29106","18.75","","S","4","","Cornwall / Akron, OH" -"2","1","Richards, Mrs. Sidney (Emily Hocking)","female","24","2","3","29106","18.75","","S","4","","Cornwall / Akron, OH" -"2","1","Ridsdale, Miss. Lucy","female","50","0","0","W./C. 14258","10.5","","S","13","","London, England / Marietta, Ohio and Milwaukee, WI" -"2","0","Rogers, Mr. Reginald Harry","male","19","0","0","28004","10.5","","S","","","" -"2","1","Rugg, Miss. Emily","female","21","0","0","C.A. 31026","10.5","","S","12","","Guernsey / Wilmington, DE" -"2","0","Schmidt, Mr. August","male","26","0","0","248659","13","","S","","","Newark, NJ" -"2","0","Sedgwick, Mr. Charles Frederick Waddington","male","25","0","0","244361","13","","S","","","Liverpool" -"2","0","Sharp, Mr. Percival James R","male","27","0","0","244358","26","","S","","","Hornsey, England" -"2","1","Shelley, Mrs. William (Imanita Parrish Hall)","female","25","0","1","230433","26","","S","12","","Deer Lodge, MT" -"2","1","Silven, Miss. Lyyli Karoliina","female","18","0","2","250652","13","","S","16","","Finland / Minneapolis, MN" -"2","1","Sincock, Miss. Maude","female","20","0","0","C.A. 33112","36.75","","S","11","","Cornwall / Hancock, MI" -"2","1","Sinkkonen, Miss. Anna","female","30","0","0","250648","13","","S","10","","Finland / Washington, DC" -"2","0","Sjostedt, Mr. Ernst Adolf","male","59","0","0","237442","13.5","","S","","","Sault St Marie, ON" -"2","1","Slayter, Miss. Hilda Mary","female","30","0","0","234818","12.35","","Q","13","","Halifax, NS" -"2","0","Slemen, Mr. Richard James","male","35","0","0","28206","10.5","","S","","","Cornwall" -"2","1","Smith, Miss. Marion Elsie","female","40","0","0","31418","13","","S","9","","" -"2","0","Sobey, Mr. Samuel James Hayden","male","25","0","0","C.A. 29178","13","","S","","","Cornwall / Houghton, MI" -"2","0","Stanton, Mr. Samuel Ward","male","41","0","0","237734","15.0458","","C","","","New York, NY" -"2","0","Stokes, Mr. Philip Joseph","male","25","0","0","F.C.C. 13540","10.5","","S","","81","Catford, Kent / Detroit, MI" -"2","0","Swane, Mr. George","male","18.5","0","0","248734","13","F","S","","294","" -"2","0","Sweet, Mr. George Frederick","male","14","0","0","220845","65","","S","","","Somerset / Bernardsville, NJ" -"2","1","Toomey, Miss. Ellen","female","50","0","0","F.C.C. 13531","10.5","","S","9","","Indianapolis, IN" -"2","0","Troupiansky, Mr. Moses Aaron","male","23","0","0","233639","13","","S","","","" -"2","1","Trout, Mrs. William H (Jessie L)","female","28","0","0","240929","12.65","","S","","","Columbus, OH" -"2","1","Troutt, Miss. Edwina Celia ""Winnie""","female","27","0","0","34218","10.5","E101","S","16","","Bath, England / Massachusetts" -"2","0","Turpin, Mr. William John Robert","male","29","1","0","11668","21","","S","","","Plymouth, England" -"2","0","Turpin, Mrs. William John Robert (Dorothy Ann Wonnacott)","female","27","1","0","11668","21","","S","","","Plymouth, England" -"2","0","Veal, Mr. James","male","40","0","0","28221","13","","S","","","Barre, Co Washington, VT" -"2","1","Walcroft, Miss. Nellie","female","31","0","0","F.C.C. 13528","21","","S","14","","Mamaroneck, NY" -"2","0","Ware, Mr. John James","male","30","1","0","CA 31352","21","","S","","","Bristol, England / New Britain, CT" -"2","0","Ware, Mr. William Jeffery","male","23","1","0","28666","10.5","","S","","","" -"2","1","Ware, Mrs. John James (Florence Louise Long)","female","31","0","0","CA 31352","21","","S","10","","Bristol, England / New Britain, CT" -"2","0","Watson, Mr. Ennis Hastings","male","","0","0","239856","0","","S","","","Belfast" -"2","1","Watt, Miss. Bertha J","female","12","0","0","C.A. 33595","15.75","","S","9","","Aberdeen / Portland, OR" -"2","1","Watt, Mrs. James (Elizabeth ""Bessie"" Inglis Milne)","female","40","0","0","C.A. 33595","15.75","","S","9","","Aberdeen / Portland, OR" -"2","1","Webber, Miss. Susan","female","32.5","0","0","27267","13","E101","S","12","","England / Hartford, CT" -"2","0","Weisz, Mr. Leopold","male","27","1","0","228414","26","","S","","293","Bromsgrove, England / Montreal, PQ" -"2","1","Weisz, Mrs. Leopold (Mathilde Francoise Pede)","female","29","1","0","228414","26","","S","10","","Bromsgrove, England / Montreal, PQ" -"2","1","Wells, Master. Ralph Lester","male","2","1","1","29103","23","","S","14","","Cornwall / Akron, OH" -"2","1","Wells, Miss. Joan","female","4","1","1","29103","23","","S","14","","Cornwall / Akron, OH" -"2","1","Wells, Mrs. Arthur Henry (""Addie"" Dart Trevaskis)","female","29","0","2","29103","23","","S","14","","Cornwall / Akron, OH" -"2","1","West, Miss. Barbara J","female","0.9167","1","2","C.A. 34651","27.75","","S","10","","Bournmouth, England" -"2","1","West, Miss. Constance Mirium","female","5","1","2","C.A. 34651","27.75","","S","10","","Bournmouth, England" -"2","0","West, Mr. Edwy Arthur","male","36","1","2","C.A. 34651","27.75","","S","","","Bournmouth, England" -"2","1","West, Mrs. Edwy Arthur (Ada Mary Worth)","female","33","1","2","C.A. 34651","27.75","","S","10","","Bournmouth, England" -"2","0","Wheadon, Mr. Edward H","male","66","0","0","C.A. 24579","10.5","","S","","","Guernsey, England / Edgewood, RI" -"2","0","Wheeler, Mr. Edwin ""Frederick""","male","","0","0","SC/PARIS 2159","12.875","","S","","","" -"2","1","Wilhelms, Mr. Charles","male","31","0","0","244270","13","","S","9","","London, England" -"2","1","Williams, Mr. Charles Eugene","male","","0","0","244373","13","","S","14","","Harrow, England" -"2","1","Wright, Miss. Marion","female","26","0","0","220844","13.5","","S","9","","Yoevil, England / Cottage Grove, OR" -"2","0","Yrois, Miss. Henriette (""Mrs Harbeck"")","female","24","0","0","248747","13","","S","","","Paris" -"3","0","Abbing, Mr. Anthony","male","42","0","0","C.A. 5547","7.55","","S","","","" -"3","0","Abbott, Master. Eugene Joseph","male","13","0","2","C.A. 2673","20.25","","S","","","East Providence, RI" -"3","0","Abbott, Mr. Rossmore Edward","male","16","1","1","C.A. 2673","20.25","","S","","190","East Providence, RI" -"3","1","Abbott, Mrs. Stanton (Rosa Hunt)","female","35","1","1","C.A. 2673","20.25","","S","A","","East Providence, RI" -"3","1","Abelseth, Miss. Karen Marie","female","16","0","0","348125","7.65","","S","16","","Norway Los Angeles, CA" -"3","1","Abelseth, Mr. Olaus Jorgensen","male","25","0","0","348122","7.65","F G63","S","A","","Perkins County, SD" -"3","1","Abrahamsson, Mr. Abraham August Johannes","male","20","0","0","SOTON/O2 3101284","7.925","","S","15","","Taalintehdas, Finland Hoboken, NJ" -"3","1","Abrahim, Mrs. Joseph (Sophie Halaut Easu)","female","18","0","0","2657","7.2292","","C","C","","Greensburg, PA" -"3","0","Adahl, Mr. Mauritz Nils Martin","male","30","0","0","C 7076","7.25","","S","","72","Asarum, Sweden Brooklyn, NY" -"3","0","Adams, Mr. John","male","26","0","0","341826","8.050000000000001","","S","","103","Bournemouth, England" -"3","0","Ahlin, Mrs. Johan (Johanna Persdotter Larsson)","female","40","1","0","7546","9.475","","S","","","Sweden Akeley, MN" -"3","1","Aks, Master. Philip Frank","male","0.8333","0","1","392091","9.35","","S","11","","London, England Norfolk, VA" -"3","1","Aks, Mrs. Sam (Leah Rosen)","female","18","0","1","392091","9.35","","S","13","","London, England Norfolk, VA" -"3","1","Albimona, Mr. Nassef Cassem","male","26","0","0","2699","18.7875","","C","15","","Syria Fredericksburg, VA" -"3","0","Alexander, Mr. William","male","26","0","0","3474","7.8875","","S","","","England Albion, NY" -"3","0","Alhomaki, Mr. Ilmari Rudolf","male","20","0","0","SOTON/O2 3101287","7.925","","S","","","Salo, Finland Astoria, OR" -"3","0","Ali, Mr. Ahmed","male","24","0","0","SOTON/O.Q. 3101311","7.05","","S","","","" -"3","0","Ali, Mr. William","male","25","0","0","SOTON/O.Q. 3101312","7.05","","S","","79","Argentina" -"3","0","Allen, Mr. William Henry","male","35","0","0","373450","8.050000000000001","","S","","","Lower Clapton, Middlesex or Erdington, Birmingham" -"3","0","Allum, Mr. Owen George","male","18","0","0","2223","8.300000000000001","","S","","259","Windsor, England New York, NY" -"3","0","Andersen, Mr. Albert Karvin","male","32","0","0","C 4001","22.525","","S","","260","Bergen, Norway" -"3","1","Andersen-Jensen, Miss. Carla Christine Nielsine","female","19","1","0","350046","7.8542","","S","16","","" -"3","0","Andersson, Master. Sigvard Harald Elias","male","4","4","2","347082","31.275","","S","","","Sweden Winnipeg, MN" -"3","0","Andersson, Miss. Ebba Iris Alfrida","female","6","4","2","347082","31.275","","S","","","Sweden Winnipeg, MN" -"3","0","Andersson, Miss. Ellis Anna Maria","female","2","4","2","347082","31.275","","S","","","Sweden Winnipeg, MN" -"3","1","Andersson, Miss. Erna Alexandra","female","17","4","2","3101281","7.925","","S","D","","Ruotsinphyhtaa, Finland New York, NY" -"3","0","Andersson, Miss. Ida Augusta Margareta","female","38","4","2","347091","7.775","","S","","","Vadsbro, Sweden Ministee, MI" -"3","0","Andersson, Miss. Ingeborg Constanzia","female","9","4","2","347082","31.275","","S","","","Sweden Winnipeg, MN" -"3","0","Andersson, Miss. Sigrid Elisabeth","female","11","4","2","347082","31.275","","S","","","Sweden Winnipeg, MN" -"3","0","Andersson, Mr. Anders Johan","male","39","1","5","347082","31.275","","S","","","Sweden Winnipeg, MN" -"3","1","Andersson, Mr. August Edvard (""Wennerstrom"")","male","27","0","0","350043","7.7958","","S","A","","" -"3","0","Andersson, Mr. Johan Samuel","male","26","0","0","347075","7.775","","S","","","Hartford, CT" -"3","0","Andersson, Mrs. Anders Johan (Alfrida Konstantia Brogren)","female","39","1","5","347082","31.275","","S","","","Sweden Winnipeg, MN" -"3","0","Andreasson, Mr. Paul Edvin","male","20","0","0","347466","7.8542","","S","","","Sweden Chicago, IL" -"3","0","Angheloff, Mr. Minko","male","26","0","0","349202","7.8958","","S","","","Bulgaria Chicago, IL" -"3","0","Arnold-Franchi, Mr. Josef","male","25","1","0","349237","17.8","","S","","","Altdorf, Switzerland" -"3","0","Arnold-Franchi, Mrs. Josef (Josefine Franchi)","female","18","1","0","349237","17.8","","S","","","Altdorf, Switzerland" -"3","0","Aronsson, Mr. Ernst Axel Algot","male","24","0","0","349911","7.775","","S","","","Sweden Joliet, IL" -"3","0","Asim, Mr. Adola","male","35","0","0","SOTON/O.Q. 3101310","7.05","","S","","","" -"3","0","Asplund, Master. Carl Edgar","male","5","4","2","347077","31.3875","","S","","","Sweden Worcester, MA" -"3","0","Asplund, Master. Clarence Gustaf Hugo","male","9","4","2","347077","31.3875","","S","","","Sweden Worcester, MA" -"3","1","Asplund, Master. Edvin Rojj Felix","male","3","4","2","347077","31.3875","","S","15","","Sweden Worcester, MA" -"3","0","Asplund, Master. Filip Oscar","male","13","4","2","347077","31.3875","","S","","","Sweden Worcester, MA" -"3","1","Asplund, Miss. Lillian Gertrud","female","5","4","2","347077","31.3875","","S","15","","Sweden Worcester, MA" -"3","0","Asplund, Mr. Carl Oscar Vilhelm Gustafsson","male","40","1","5","347077","31.3875","","S","","142","Sweden Worcester, MA" -"3","1","Asplund, Mr. Johan Charles","male","23","0","0","350054","7.7958","","S","13","","Oskarshamn, Sweden Minneapolis, MN" -"3","1","Asplund, Mrs. Carl Oscar (Selma Augusta Emilia Johansson)","female","38","1","5","347077","31.3875","","S","15","","Sweden Worcester, MA" -"3","1","Assaf Khalil, Mrs. Mariana (""Miriam"")","female","45","0","0","2696","7.225","","C","C","","Ottawa, ON" -"3","0","Assaf, Mr. Gerios","male","21","0","0","2692","7.225","","C","","","Ottawa, ON" -"3","0","Assam, Mr. Ali","male","23","0","0","SOTON/O.Q. 3101309","7.05","","S","","","" -"3","0","Attalah, Miss. Malake","female","17","0","0","2627","14.4583","","C","","","" -"3","0","Attalah, Mr. Sleiman","male","30","0","0","2694","7.225","","C","","","Ottawa, ON" -"3","0","Augustsson, Mr. Albert","male","23","0","0","347468","7.8542","","S","","","Krakoryd, Sweden Bloomington, IL" -"3","1","Ayoub, Miss. Banoura","female","13","0","0","2687","7.2292","","C","C","","Syria Youngstown, OH" -"3","0","Baccos, Mr. Raffull","male","20","0","0","2679","7.225","","C","","","" -"3","0","Backstrom, Mr. Karl Alfred","male","32","1","0","3101278","15.85","","S","D","","Ruotsinphytaa, Finland New York, NY" -"3","1","Backstrom, Mrs. Karl Alfred (Maria Mathilda Gustafsson)","female","33","3","0","3101278","15.85","","S","","","Ruotsinphytaa, Finland New York, NY" -"3","1","Baclini, Miss. Eugenie","female","0.75","2","1","2666","19.2583","","C","C","","Syria New York, NY" -"3","1","Baclini, Miss. Helene Barbara","female","0.75","2","1","2666","19.2583","","C","C","","Syria New York, NY" -"3","1","Baclini, Miss. Marie Catherine","female","5","2","1","2666","19.2583","","C","C","","Syria New York, NY" -"3","1","Baclini, Mrs. Solomon (Latifa Qurban)","female","24","0","3","2666","19.2583","","C","C","","Syria New York, NY" -"3","1","Badman, Miss. Emily Louisa","female","18","0","0","A/4 31416","8.050000000000001","","S","C","","London Skanteales, NY" -"3","0","Badt, Mr. Mohamed","male","40","0","0","2623","7.225","","C","","","" -"3","0","Balkic, Mr. Cerin","male","26","0","0","349248","7.8958","","S","","","" -"3","1","Barah, Mr. Hanna Assi","male","20","0","0","2663","7.2292","","C","15","","" -"3","0","Barbara, Miss. Saiide","female","18","0","1","2691","14.4542","","C","","","Syria Ottawa, ON" -"3","0","Barbara, Mrs. (Catherine David)","female","45","0","1","2691","14.4542","","C","","","Syria Ottawa, ON" -"3","0","Barry, Miss. Julia","female","27","0","0","330844","7.8792","","Q","","","New York, NY" -"3","0","Barton, Mr. David John","male","22","0","0","324669","8.050000000000001","","S","","","England New York, NY" -"3","0","Beavan, Mr. William Thomas","male","19","0","0","323951","8.050000000000001","","S","","","England" -"3","0","Bengtsson, Mr. John Viktor","male","26","0","0","347068","7.775","","S","","","Krakudden, Sweden Moune, IL" -"3","0","Berglund, Mr. Karl Ivar Sven","male","22","0","0","PP 4348","9.35","","S","","","Tranvik, Finland New York" -"3","0","Betros, Master. Seman","male","","0","0","2622","7.2292","","C","","","" -"3","0","Betros, Mr. Tannous","male","20","0","0","2648","4.0125","","C","","","Syria" -"3","1","Bing, Mr. Lee","male","32","0","0","1601","56.4958","","S","C","","Hong Kong New York, NY" -"3","0","Birkeland, Mr. Hans Martin Monsen","male","21","0","0","312992","7.775","","S","","","Brennes, Norway New York" -"3","0","Bjorklund, Mr. Ernst Herbert","male","18","0","0","347090","7.75","","S","","","Stockholm, Sweden New York" -"3","0","Bostandyeff, Mr. Guentcho","male","26","0","0","349224","7.8958","","S","","","Bulgaria Chicago, IL" -"3","0","Boulos, Master. Akar","male","6","1","1","2678","15.2458","","C","","","Syria Kent, ON" -"3","0","Boulos, Miss. Nourelain","female","9","1","1","2678","15.2458","","C","","","Syria Kent, ON" -"3","0","Boulos, Mr. Hanna","male","","0","0","2664","7.225","","C","","","Syria" -"3","0","Boulos, Mrs. Joseph (Sultana)","female","","0","2","2678","15.2458","","C","","","Syria Kent, ON" -"3","0","Bourke, Miss. Mary","female","","0","2","364848","7.75","","Q","","","Ireland Chicago, IL" -"3","0","Bourke, Mr. John","male","40","1","1","364849","15.5","","Q","","","Ireland Chicago, IL" -"3","0","Bourke, Mrs. John (Catherine)","female","32","1","1","364849","15.5","","Q","","","Ireland Chicago, IL" -"3","0","Bowen, Mr. David John ""Dai""","male","21","0","0","54636","16.1","","S","","","Treherbert, Cardiff, Wales" -"3","1","Bradley, Miss. Bridget Delia","female","22","0","0","334914","7.725","","Q","13","","Kingwilliamstown, Co Cork, Ireland Glens Falls, NY" -"3","0","Braf, Miss. Elin Ester Maria","female","20","0","0","347471","7.8542","","S","","","Medeltorp, Sweden Chicago, IL" -"3","0","Braund, Mr. Lewis Richard","male","29","1","0","3460","7.0458","","S","","","Bridgerule, Devon" -"3","0","Braund, Mr. Owen Harris","male","22","1","0","A/5 21171","7.25","","S","","","Bridgerule, Devon" -"3","0","Brobeck, Mr. Karl Rudolf","male","22","0","0","350045","7.7958","","S","","","Sweden Worcester, MA" -"3","0","Brocklebank, Mr. William Alfred","male","35","0","0","364512","8.050000000000001","","S","","","Broomfield, Chelmsford, England" -"3","0","Buckley, Miss. Katherine","female","18.5","0","0","329944","7.2833","","Q","","299","Co Cork, Ireland Roxbury, MA" -"3","1","Buckley, Mr. Daniel","male","21","0","0","330920","7.8208","","Q","13","","Kingwilliamstown, Co Cork, Ireland New York, NY" -"3","0","Burke, Mr. Jeremiah","male","19","0","0","365222","6.75","","Q","","","Co Cork, Ireland Charlestown, MA" -"3","0","Burns, Miss. Mary Delia","female","18","0","0","330963","7.8792","","Q","","","Co Sligo, Ireland New York, NY" -"3","0","Cacic, Miss. Manda","female","21","0","0","315087","8.6625","","S","","","" -"3","0","Cacic, Miss. Marija","female","30","0","0","315084","8.6625","","S","","","" -"3","0","Cacic, Mr. Jego Grga","male","18","0","0","315091","8.6625","","S","","","" -"3","0","Cacic, Mr. Luka","male","38","0","0","315089","8.6625","","S","","","Croatia" -"3","0","Calic, Mr. Jovo","male","17","0","0","315093","8.6625","","S","","","" -"3","0","Calic, Mr. Petar","male","17","0","0","315086","8.6625","","S","","","" -"3","0","Canavan, Miss. Mary","female","21","0","0","364846","7.75","","Q","","","" -"3","0","Canavan, Mr. Patrick","male","21","0","0","364858","7.75","","Q","","","Ireland Philadelphia, PA" -"3","0","Cann, Mr. Ernest Charles","male","21","0","0","A./5. 2152","8.050000000000001","","S","","","" -"3","0","Caram, Mr. Joseph","male","","1","0","2689","14.4583","","C","","","Ottawa, ON" -"3","0","Caram, Mrs. Joseph (Maria Elias)","female","","1","0","2689","14.4583","","C","","","Ottawa, ON" -"3","0","Carlsson, Mr. August Sigfrid","male","28","0","0","350042","7.7958","","S","","","Dagsas, Sweden Fower, MN" -"3","0","Carlsson, Mr. Carl Robert","male","24","0","0","350409","7.8542","","S","","","Goteborg, Sweden Huntley, IL" -"3","1","Carr, Miss. Helen ""Ellen""","female","16","0","0","367231","7.75","","Q","16","","Co Longford, Ireland New York, NY" -"3","0","Carr, Miss. Jeannie","female","37","0","0","368364","7.75","","Q","","","Co Sligo, Ireland Hartford, CT" -"3","0","Carver, Mr. Alfred John","male","28","0","0","392095","7.25","","S","","","St Denys, Southampton, Hants" -"3","0","Celotti, Mr. Francesco","male","24","0","0","343275","8.050000000000001","","S","","","London" -"3","0","Charters, Mr. David","male","21","0","0","A/5. 13032","7.7333","","Q","","","Ireland New York, NY" -"3","1","Chip, Mr. Chang","male","32","0","0","1601","56.4958","","S","C","","Hong Kong New York, NY" -"3","0","Christmann, Mr. Emil","male","29","0","0","343276","8.050000000000001","","S","","","" -"3","0","Chronopoulos, Mr. Apostolos","male","26","1","0","2680","14.4542","","C","","","Greece" -"3","0","Chronopoulos, Mr. Demetrios","male","18","1","0","2680","14.4542","","C","","","Greece" -"3","0","Coelho, Mr. Domingos Fernandeo","male","20","0","0","SOTON/O.Q. 3101307","7.05","","S","","","Portugal" -"3","1","Cohen, Mr. Gurshon ""Gus""","male","18","0","0","A/5 3540","8.050000000000001","","S","12","","London Brooklyn, NY" -"3","0","Colbert, Mr. Patrick","male","24","0","0","371109","7.25","","Q","","","Co Limerick, Ireland Sherbrooke, PQ" -"3","0","Coleff, Mr. Peju","male","36","0","0","349210","7.4958","","S","","","Bulgaria Chicago, IL" -"3","0","Coleff, Mr. Satio","male","24","0","0","349209","7.4958","","S","","","" -"3","0","Conlon, Mr. Thomas Henry","male","31","0","0","21332","7.7333","","Q","","","Philadelphia, PA" -"3","0","Connaghton, Mr. Michael","male","31","0","0","335097","7.75","","Q","","","Ireland Brooklyn, NY" -"3","1","Connolly, Miss. Kate","female","22","0","0","370373","7.75","","Q","13","","Ireland" -"3","0","Connolly, Miss. Kate","female","30","0","0","330972","7.6292","","Q","","","Ireland" -"3","0","Connors, Mr. Patrick","male","70.5","0","0","370369","7.75","","Q","","171","" -"3","0","Cook, Mr. Jacob","male","43","0","0","A/5 3536","8.050000000000001","","S","","","" -"3","0","Cor, Mr. Bartol","male","35","0","0","349230","7.8958","","S","","","Austria" -"3","0","Cor, Mr. Ivan","male","27","0","0","349229","7.8958","","S","","","Austria" -"3","0","Cor, Mr. Liudevit","male","19","0","0","349231","7.8958","","S","","","Austria" -"3","0","Corn, Mr. Harry","male","30","0","0","SOTON/OQ 392090","8.050000000000001","","S","","","London" -"3","1","Coutts, Master. Eden Leslie ""Neville""","male","9","1","1","C.A. 37671","15.9","","S","2","","England Brooklyn, NY" -"3","1","Coutts, Master. William Loch ""William""","male","3","1","1","C.A. 37671","15.9","","S","2","","England Brooklyn, NY" -"3","1","Coutts, Mrs. William (Winnie ""Minnie"" Treanor)","female","36","0","2","C.A. 37671","15.9","","S","2","","England Brooklyn, NY" -"3","0","Coxon, Mr. Daniel","male","59","0","0","364500","7.25","","S","","","Merrill, WI" -"3","0","Crease, Mr. Ernest James","male","19","0","0","S.P. 3464","8.158300000000001","","S","","","Bristol, England Cleveland, OH" -"3","1","Cribb, Miss. Laura Alice","female","17","0","1","371362","16.1","","S","12","","Bournemouth, England Newark, NJ" -"3","0","Cribb, Mr. John Hatfield","male","44","0","1","371362","16.1","","S","","","Bournemouth, England Newark, NJ" -"3","0","Culumovic, Mr. Jeso","male","17","0","0","315090","8.6625","","S","","","Austria-Hungary" -"3","0","Daher, Mr. Shedid","male","22.5","0","0","2698","7.225","","C","","9","" -"3","1","Dahl, Mr. Karl Edwart","male","45","0","0","7598","8.050000000000001","","S","15","","Australia Fingal, ND" -"3","0","Dahlberg, Miss. Gerda Ulrika","female","22","0","0","7552","10.5167","","S","","","Norrlot, Sweden Chicago, IL" -"3","0","Dakic, Mr. Branko","male","19","0","0","349228","10.1708","","S","","","Austria" -"3","1","Daly, Miss. Margaret Marcella ""Maggie""","female","30","0","0","382650","6.95","","Q","15","","Co Athlone, Ireland New York, NY" -"3","1","Daly, Mr. Eugene Patrick","male","29","0","0","382651","7.75","","Q","13 15 B","","Co Athlone, Ireland New York, NY" -"3","0","Danbom, Master. Gilbert Sigvard Emanuel","male","0.3333","0","2","347080","14.4","","S","","","Stanton, IA" -"3","0","Danbom, Mr. Ernst Gilbert","male","34","1","1","347080","14.4","","S","","197","Stanton, IA" -"3","0","Danbom, Mrs. Ernst Gilbert (Anna Sigrid Maria Brogren)","female","28","1","1","347080","14.4","","S","","","Stanton, IA" -"3","0","Danoff, Mr. Yoto","male","27","0","0","349219","7.8958","","S","","","Bulgaria Chicago, IL" -"3","0","Dantcheff, Mr. Ristiu","male","25","0","0","349203","7.8958","","S","","","Bulgaria Chicago, IL" -"3","0","Davies, Mr. Alfred J","male","24","2","0","A/4 48871","24.15","","S","","","West Bromwich, England Pontiac, MI" -"3","0","Davies, Mr. Evan","male","22","0","0","SC/A4 23568","8.050000000000001","","S","","","" -"3","0","Davies, Mr. John Samuel","male","21","2","0","A/4 48871","24.15","","S","","","West Bromwich, England Pontiac, MI" -"3","0","Davies, Mr. Joseph","male","17","2","0","A/4 48873","8.050000000000001","","S","","","West Bromwich, England Pontiac, MI" -"3","0","Davison, Mr. Thomas Henry","male","","1","0","386525","16.1","","S","","","Liverpool, England Bedford, OH" -"3","1","Davison, Mrs. Thomas Henry (Mary E Finck)","female","","1","0","386525","16.1","","S","16","","Liverpool, England Bedford, OH" -"3","1","de Messemaeker, Mr. Guillaume Joseph","male","36.5","1","0","345572","17.4","","S","15","","Tampico, MT" -"3","1","de Messemaeker, Mrs. Guillaume Joseph (Emma)","female","36","1","0","345572","17.4","","S","13","","Tampico, MT" -"3","1","de Mulder, Mr. Theodore","male","30","0","0","345774","9.5","","S","11","","Belgium Detroit, MI" -"3","0","de Pelsmaeker, Mr. Alfons","male","16","0","0","345778","9.5","","S","","","" -"3","1","Dean, Master. Bertram Vere","male","1","1","2","C.A. 2315","20.575","","S","10","","Devon, England Wichita, KS" -"3","1","Dean, Miss. Elizabeth Gladys ""Millvina""","female","0.1667","1","2","C.A. 2315","20.575","","S","10","","Devon, England Wichita, KS" -"3","0","Dean, Mr. Bertram Frank","male","26","1","2","C.A. 2315","20.575","","S","","","Devon, England Wichita, KS" -"3","1","Dean, Mrs. Bertram (Eva Georgetta Light)","female","33","1","2","C.A. 2315","20.575","","S","10","","Devon, England Wichita, KS" -"3","0","Delalic, Mr. Redjo","male","25","0","0","349250","7.8958","","S","","","" -"3","0","Demetri, Mr. Marinko","male","","0","0","349238","7.8958","","S","","","" -"3","0","Denkoff, Mr. Mitto","male","","0","0","349225","7.8958","","S","","","Bulgaria Coon Rapids, IA" -"3","0","Dennis, Mr. Samuel","male","22","0","0","A/5 21172","7.25","","S","","","" -"3","0","Dennis, Mr. William","male","36","0","0","A/5 21175","7.25","","S","","","" -"3","1","Devaney, Miss. Margaret Delia","female","19","0","0","330958","7.8792","","Q","C","","Kilmacowen, Co Sligo, Ireland New York, NY" -"3","0","Dika, Mr. Mirko","male","17","0","0","349232","7.8958","","S","","","" -"3","0","Dimic, Mr. Jovan","male","42","0","0","315088","8.6625","","S","","","" -"3","0","Dintcheff, Mr. Valtcho","male","43","0","0","349226","7.8958","","S","","","" -"3","0","Doharr, Mr. Tannous","male","","0","0","2686","7.2292","","C","","","" -"3","0","Dooley, Mr. Patrick","male","32","0","0","370376","7.75","","Q","","","Ireland New York, NY" -"3","1","Dorking, Mr. Edward Arthur","male","19","0","0","A/5. 10482","8.050000000000001","","S","B","","England Oglesby, IL" -"3","1","Dowdell, Miss. Elizabeth","female","30","0","0","364516","12.475","","S","13","","Union Hill, NJ" -"3","0","Doyle, Miss. Elizabeth","female","24","0","0","368702","7.75","","Q","","","Ireland New York, NY" -"3","1","Drapkin, Miss. Jennie","female","23","0","0","SOTON/OQ 392083","8.050000000000001","","S","","","London New York, NY" -"3","0","Drazenoic, Mr. Jozef","male","33","0","0","349241","7.8958","","C","","51","Austria Niagara Falls, NY" -"3","0","Duane, Mr. Frank","male","65","0","0","336439","7.75","","Q","","","" -"3","1","Duquemin, Mr. Joseph","male","24","0","0","S.O./P.P. 752","7.55","","S","D","","England Albion, NY" -"3","0","Dyker, Mr. Adolf Fredrik","male","23","1","0","347072","13.9","","S","","","West Haven, CT" -"3","1","Dyker, Mrs. Adolf Fredrik (Anna Elisabeth Judith Andersson)","female","22","1","0","347072","13.9","","S","16","","West Haven, CT" -"3","0","Edvardsson, Mr. Gustaf Hjalmar","male","18","0","0","349912","7.775","","S","","","Tofta, Sweden Joliet, IL" -"3","0","Eklund, Mr. Hans Linus","male","16","0","0","347074","7.775","","S","","","Karberg, Sweden Jerome Junction, AZ" -"3","0","Ekstrom, Mr. Johan","male","45","0","0","347061","6.975","","S","","","Effington Rut, SD" -"3","0","Elias, Mr. Dibo","male","","0","0","2674","7.225","","C","","","" -"3","0","Elias, Mr. Joseph","male","39","0","2","2675","7.2292","","C","","","Syria Ottawa, ON" -"3","0","Elias, Mr. Joseph Jr","male","17","1","1","2690","7.2292","","C","","","" -"3","0","Elias, Mr. Tannous","male","15","1","1","2695","7.2292","","C","","","Syria" -"3","0","Elsbury, Mr. William James","male","47","0","0","A/5 3902","7.25","","S","","","Illinois, USA" -"3","1","Emanuel, Miss. Virginia Ethel","female","5","0","0","364516","12.475","","S","13","","New York, NY" -"3","0","Emir, Mr. Farred Chehab","male","","0","0","2631","7.225","","C","","","" -"3","0","Everett, Mr. Thomas James","male","40.5","0","0","C.A. 6212","15.1","","S","","187","" -"3","0","Farrell, Mr. James","male","40.5","0","0","367232","7.75","","Q","","68","Aughnacliff, Co Longford, Ireland New York, NY" -"3","1","Finoli, Mr. Luigi","male","","0","0","SOTON/O.Q. 3101308","7.05","","S","15","","Italy Philadelphia, PA" -"3","0","Fischer, Mr. Eberhard Thelander","male","18","0","0","350036","7.7958","","S","","","" -"3","0","Fleming, Miss. Honora","female","","0","0","364859","7.75","","Q","","","" -"3","0","Flynn, Mr. James","male","","0","0","364851","7.75","","Q","","","" -"3","0","Flynn, Mr. John","male","","0","0","368323","6.95","","Q","","","" -"3","0","Foley, Mr. Joseph","male","26","0","0","330910","7.8792","","Q","","","Ireland Chicago, IL" -"3","0","Foley, Mr. William","male","","0","0","365235","7.75","","Q","","","Ireland" -"3","1","Foo, Mr. Choong","male","","0","0","1601","56.4958","","S","13","","Hong Kong New York, NY" -"3","0","Ford, Miss. Doolina Margaret ""Daisy""","female","21","2","2","W./C. 6608","34.375","","S","","","Rotherfield, Sussex, England Essex Co, MA" -"3","0","Ford, Miss. Robina Maggie ""Ruby""","female","9","2","2","W./C. 6608","34.375","","S","","","Rotherfield, Sussex, England Essex Co, MA" -"3","0","Ford, Mr. Arthur","male","","0","0","A/5 1478","8.050000000000001","","S","","","Bridgwater, Somerset, England" -"3","0","Ford, Mr. Edward Watson","male","18","2","2","W./C. 6608","34.375","","S","","","Rotherfield, Sussex, England Essex Co, MA" -"3","0","Ford, Mr. William Neal","male","16","1","3","W./C. 6608","34.375","","S","","","Rotherfield, Sussex, England Essex Co, MA" -"3","0","Ford, Mrs. Edward (Margaret Ann Watson)","female","48","1","3","W./C. 6608","34.375","","S","","","Rotherfield, Sussex, England Essex Co, MA" -"3","0","Fox, Mr. Patrick","male","","0","0","368573","7.75","","Q","","","Ireland New York, NY" -"3","0","Franklin, Mr. Charles (Charles Fardon)","male","","0","0","SOTON/O.Q. 3101314","7.25","","S","","","" -"3","0","Gallagher, Mr. Martin","male","25","0","0","36864","7.7417","","Q","","","New York, NY" -"3","0","Garfirth, Mr. John","male","","0","0","358585","14.5","","S","","","" -"3","0","Gheorgheff, Mr. Stanio","male","","0","0","349254","7.8958","","C","","","" -"3","0","Gilinski, Mr. Eliezer","male","22","0","0","14973","8.050000000000001","","S","","47","" -"3","1","Gilnagh, Miss. Katherine ""Katie""","female","16","0","0","35851","7.7333","","Q","16","","Co Longford, Ireland New York, NY" -"3","1","Glynn, Miss. Mary Agatha","female","","0","0","335677","7.75","","Q","13","","Co Clare, Ireland Washington, DC" -"3","1","Goldsmith, Master. Frank John William ""Frankie""","male","9","0","2","363291","20.525","","S","C D","","Strood, Kent, England Detroit, MI" -"3","0","Goldsmith, Mr. Frank John","male","33","1","1","363291","20.525","","S","","","Strood, Kent, England Detroit, MI" -"3","0","Goldsmith, Mr. Nathan","male","41","0","0","SOTON/O.Q. 3101263","7.85","","S","","","Philadelphia, PA" -"3","1","Goldsmith, Mrs. Frank John (Emily Alice Brown)","female","31","1","1","363291","20.525","","S","C D","","Strood, Kent, England Detroit, MI" -"3","0","Goncalves, Mr. Manuel Estanslas","male","38","0","0","SOTON/O.Q. 3101306","7.05","","S","","","Portugal" -"3","0","Goodwin, Master. Harold Victor","male","9","5","2","CA 2144","46.9","","S","","","Wiltshire, England Niagara Falls, NY" -"3","0","Goodwin, Master. Sidney Leonard","male","1","5","2","CA 2144","46.9","","S","","","Wiltshire, England Niagara Falls, NY" -"3","0","Goodwin, Master. William Frederick","male","11","5","2","CA 2144","46.9","","S","","","Wiltshire, England Niagara Falls, NY" -"3","0","Goodwin, Miss. Jessie Allis","female","10","5","2","CA 2144","46.9","","S","","","Wiltshire, England Niagara Falls, NY" -"3","0","Goodwin, Miss. Lillian Amy","female","16","5","2","CA 2144","46.9","","S","","","Wiltshire, England Niagara Falls, NY" -"3","0","Goodwin, Mr. Charles Edward","male","14","5","2","CA 2144","46.9","","S","","","Wiltshire, England Niagara Falls, NY" -"3","0","Goodwin, Mr. Charles Frederick","male","40","1","6","CA 2144","46.9","","S","","","Wiltshire, England Niagara Falls, NY" -"3","0","Goodwin, Mrs. Frederick (Augusta Tyler)","female","43","1","6","CA 2144","46.9","","S","","","Wiltshire, England Niagara Falls, NY" -"3","0","Green, Mr. George Henry","male","51","0","0","21440","8.050000000000001","","S","","","Dorking, Surrey, England" -"3","0","Gronnestad, Mr. Daniel Danielsen","male","32","0","0","8471","8.362500000000001","","S","","","Foresvik, Norway Portland, ND" -"3","0","Guest, Mr. Robert","male","","0","0","376563","8.050000000000001","","S","","","" -"3","0","Gustafsson, Mr. Alfred Ossian","male","20","0","0","7534","9.845800000000001","","S","","","Waukegan, Chicago, IL" -"3","0","Gustafsson, Mr. Anders Vilhelm","male","37","2","0","3101276","7.925","","S","","98","Ruotsinphytaa, Finland New York, NY" -"3","0","Gustafsson, Mr. Johan Birger","male","28","2","0","3101277","7.925","","S","","","Ruotsinphytaa, Finland New York, NY" -"3","0","Gustafsson, Mr. Karl Gideon","male","19","0","0","347069","7.775","","S","","","Myren, Sweden New York, NY" -"3","0","Haas, Miss. Aloisia","female","24","0","0","349236","8.85","","S","","","" -"3","0","Hagardon, Miss. Kate","female","17","0","0","AQ/3. 30631","7.7333","","Q","","","" -"3","0","Hagland, Mr. Ingvald Olai Olsen","male","","1","0","65303","19.9667","","S","","","" -"3","0","Hagland, Mr. Konrad Mathias Reiersen","male","","1","0","65304","19.9667","","S","","","" -"3","0","Hakkarainen, Mr. Pekka Pietari","male","28","1","0","STON/O2. 3101279","15.85","","S","","","" -"3","1","Hakkarainen, Mrs. Pekka Pietari (Elin Matilda Dolck)","female","24","1","0","STON/O2. 3101279","15.85","","S","15","","" -"3","0","Hampe, Mr. Leon","male","20","0","0","345769","9.5","","S","","","" -"3","0","Hanna, Mr. Mansour","male","23.5","0","0","2693","7.2292","","C","","188","" -"3","0","Hansen, Mr. Claus Peter","male","41","2","0","350026","14.1083","","S","","","" -"3","0","Hansen, Mr. Henrik Juul","male","26","1","0","350025","7.8542","","S","","","" -"3","0","Hansen, Mr. Henry Damsgaard","male","21","0","0","350029","7.8542","","S","","69","" -"3","1","Hansen, Mrs. Claus Peter (Jennie L Howard)","female","45","1","0","350026","14.1083","","S","11","","" -"3","0","Harknett, Miss. Alice Phoebe","female","","0","0","W./C. 6609","7.55","","S","","","" -"3","0","Harmer, Mr. Abraham (David Lishin)","male","25","0","0","374887","7.25","","S","B","","" -"3","0","Hart, Mr. Henry","male","","0","0","394140","6.8583","","Q","","","" -"3","0","Hassan, Mr. Houssein G N","male","11","0","0","2699","18.7875","","C","","","" -"3","1","Healy, Miss. Hanora ""Nora""","female","","0","0","370375","7.75","","Q","16","","" -"3","1","Hedman, Mr. Oskar Arvid","male","27","0","0","347089","6.975","","S","15","","" -"3","1","Hee, Mr. Ling","male","","0","0","1601","56.4958","","S","C","","" -"3","0","Hegarty, Miss. Hanora ""Nora""","female","18","0","0","365226","6.75","","Q","","","" -"3","1","Heikkinen, Miss. Laina","female","26","0","0","STON/O2. 3101282","7.925","","S","","","" -"3","0","Heininen, Miss. Wendla Maria","female","23","0","0","STON/O2. 3101290","7.925","","S","","","" -"3","1","Hellstrom, Miss. Hilda Maria","female","22","0","0","7548","8.9625","","S","C","","" -"3","0","Hendekovic, Mr. Ignjac","male","28","0","0","349243","7.8958","","S","","306","" -"3","0","Henriksson, Miss. Jenny Lovisa","female","28","0","0","347086","7.775","","S","","","" -"3","0","Henry, Miss. Delia","female","","0","0","382649","7.75","","Q","","","" -"3","1","Hirvonen, Miss. Hildur E","female","2","0","1","3101298","12.2875","","S","15","","" -"3","1","Hirvonen, Mrs. Alexander (Helga E Lindqvist)","female","22","1","1","3101298","12.2875","","S","15","","" -"3","0","Holm, Mr. John Fredrik Alexander","male","43","0","0","C 7075","6.45","","S","","","" -"3","0","Holthen, Mr. Johan Martin","male","28","0","0","C 4001","22.525","","S","","","" -"3","1","Honkanen, Miss. Eliina","female","27","0","0","STON/O2. 3101283","7.925","","S","","","" -"3","0","Horgan, Mr. John","male","","0","0","370377","7.75","","Q","","","" -"3","1","Howard, Miss. May Elizabeth","female","","0","0","A. 2. 39186","8.050000000000001","","S","C","","" -"3","0","Humblen, Mr. Adolf Mathias Nicolai Olsen","male","42","0","0","348121","7.65","F G63","S","","120","" -"3","1","Hyman, Mr. Abraham","male","","0","0","3470","7.8875","","S","C","","" -"3","0","Ibrahim Shawah, Mr. Yousseff","male","30","0","0","2685","7.2292","","C","","","" -"3","0","Ilieff, Mr. Ylio","male","","0","0","349220","7.8958","","S","","","" -"3","0","Ilmakangas, Miss. Ida Livija","female","27","1","0","STON/O2. 3101270","7.925","","S","","","" -"3","0","Ilmakangas, Miss. Pieta Sofia","female","25","1","0","STON/O2. 3101271","7.925","","S","","","" -"3","0","Ivanoff, Mr. Kanio","male","","0","0","349201","7.8958","","S","","","" -"3","1","Jalsevac, Mr. Ivan","male","29","0","0","349240","7.8958","","C","15","","" -"3","1","Jansson, Mr. Carl Olof","male","21","0","0","350034","7.7958","","S","A","","" -"3","0","Jardin, Mr. Jose Neto","male","","0","0","SOTON/O.Q. 3101305","7.05","","S","","","" -"3","0","Jensen, Mr. Hans Peder","male","20","0","0","350050","7.8542","","S","","","" -"3","0","Jensen, Mr. Niels Peder","male","48","0","0","350047","7.8542","","S","","","" -"3","0","Jensen, Mr. Svend Lauritz","male","17","1","0","350048","7.0542","","S","","","" -"3","1","Jermyn, Miss. Annie","female","","0","0","14313","7.75","","Q","D","","" -"3","1","Johannesen-Bratthammer, Mr. Bernt","male","","0","0","65306","8.112500000000001","","S","13","","" -"3","0","Johanson, Mr. Jakob Alfred","male","34","0","0","3101264","6.4958","","S","","143","" -"3","1","Johansson Palmquist, Mr. Oskar Leander","male","26","0","0","347070","7.775","","S","15","","" -"3","0","Johansson, Mr. Erik","male","22","0","0","350052","7.7958","","S","","156","" -"3","0","Johansson, Mr. Gustaf Joel","male","33","0","0","7540","8.654199999999999","","S","","285","" -"3","0","Johansson, Mr. Karl Johan","male","31","0","0","347063","7.775","","S","","","" -"3","0","Johansson, Mr. Nils","male","29","0","0","347467","7.8542","","S","","","" -"3","1","Johnson, Master. Harold Theodor","male","4","1","1","347742","11.1333","","S","15","","" -"3","1","Johnson, Miss. Eleanor Ileen","female","1","1","1","347742","11.1333","","S","15","","" -"3","0","Johnson, Mr. Alfred","male","49","0","0","LINE","0","","S","","","" -"3","0","Johnson, Mr. Malkolm Joackim","male","33","0","0","347062","7.775","","S","","37","" -"3","0","Johnson, Mr. William Cahoone Jr","male","19","0","0","LINE","0","","S","","","" -"3","1","Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg)","female","27","0","2","347742","11.1333","","S","15","","" -"3","0","Johnston, Master. William Arthur ""Willie""","male","","1","2","W./C. 6607","23.45","","S","","","" -"3","0","Johnston, Miss. Catherine Helen ""Carrie""","female","","1","2","W./C. 6607","23.45","","S","","","" -"3","0","Johnston, Mr. Andrew G","male","","1","2","W./C. 6607","23.45","","S","","","" -"3","0","Johnston, Mrs. Andrew G (Elizabeth ""Lily"" Watson)","female","","1","2","W./C. 6607","23.45","","S","","","" -"3","0","Jonkoff, Mr. Lalio","male","23","0","0","349204","7.8958","","S","","","" -"3","1","Jonsson, Mr. Carl","male","32","0","0","350417","7.8542","","S","15","","" -"3","0","Jonsson, Mr. Nils Hilding","male","27","0","0","350408","7.8542","","S","","","" -"3","0","Jussila, Miss. Katriina","female","20","1","0","4136","9.824999999999999","","S","","","" -"3","0","Jussila, Miss. Mari Aina","female","21","1","0","4137","9.824999999999999","","S","","","" -"3","1","Jussila, Mr. Eiriik","male","32","0","0","STON/O 2. 3101286","7.925","","S","15","","" -"3","0","Kallio, Mr. Nikolai Erland","male","17","0","0","STON/O 2. 3101274","7.125","","S","","","" -"3","0","Kalvik, Mr. Johannes Halvorsen","male","21","0","0","8475","8.433299999999999","","S","","","" -"3","0","Karaic, Mr. Milan","male","30","0","0","349246","7.8958","","S","","","" -"3","1","Karlsson, Mr. Einar Gervasius","male","21","0","0","350053","7.7958","","S","13","","" -"3","0","Karlsson, Mr. Julius Konrad Eugen","male","33","0","0","347465","7.8542","","S","","","" -"3","0","Karlsson, Mr. Nils August","male","22","0","0","350060","7.5208","","S","","","" -"3","1","Karun, Miss. Manca","female","4","0","1","349256","13.4167","","C","15","","" -"3","1","Karun, Mr. Franz","male","39","0","1","349256","13.4167","","C","15","","" -"3","0","Kassem, Mr. Fared","male","","0","0","2700","7.2292","","C","","","" -"3","0","Katavelas, Mr. Vassilios (""Catavelas Vassilios"")","male","18.5","0","0","2682","7.2292","","C","","58","" -"3","0","Keane, Mr. Andrew ""Andy""","male","","0","0","12460","7.75","","Q","","","" -"3","0","Keefe, Mr. Arthur","male","","0","0","323592","7.25","","S","A","","" -"3","1","Kelly, Miss. Anna Katherine ""Annie Kate""","female","","0","0","9234","7.75","","Q","16","","" -"3","1","Kelly, Miss. Mary","female","","0","0","14312","7.75","","Q","D","","" -"3","0","Kelly, Mr. James","male","34.5","0","0","330911","7.8292","","Q","","70","" -"3","0","Kelly, Mr. James","male","44","0","0","363592","8.050000000000001","","S","","","" -"3","1","Kennedy, Mr. John","male","","0","0","368783","7.75","","Q","","","" -"3","0","Khalil, Mr. Betros","male","","1","0","2660","14.4542","","C","","","" -"3","0","Khalil, Mrs. Betros (Zahie ""Maria"" Elias)","female","","1","0","2660","14.4542","","C","","","" -"3","0","Kiernan, Mr. John","male","","1","0","367227","7.75","","Q","","","" -"3","0","Kiernan, Mr. Philip","male","","1","0","367229","7.75","","Q","","","" -"3","0","Kilgannon, Mr. Thomas J","male","","0","0","36865","7.7375","","Q","","","" -"3","0","Kink, Miss. Maria","female","22","2","0","315152","8.6625","","S","","","" -"3","0","Kink, Mr. Vincenz","male","26","2","0","315151","8.6625","","S","","","" -"3","1","Kink-Heilmann, Miss. Luise Gretchen","female","4","0","2","315153","22.025","","S","2","","" -"3","1","Kink-Heilmann, Mr. Anton","male","29","3","1","315153","22.025","","S","2","","" -"3","1","Kink-Heilmann, Mrs. Anton (Luise Heilmann)","female","26","1","1","315153","22.025","","S","2","","" -"3","0","Klasen, Miss. Gertrud Emilia","female","1","1","1","350405","12.1833","","S","","","" -"3","0","Klasen, Mr. Klas Albin","male","18","1","1","350404","7.8542","","S","","","" -"3","0","Klasen, Mrs. (Hulda Kristina Eugenia Lofqvist)","female","36","0","2","350405","12.1833","","S","","","" -"3","0","Kraeff, Mr. Theodor","male","","0","0","349253","7.8958","","C","","","" -"3","1","Krekorian, Mr. Neshan","male","25","0","0","2654","7.2292","F E57","C","10","","" -"3","0","Lahoud, Mr. Sarkis","male","","0","0","2624","7.225","","C","","","" -"3","0","Laitinen, Miss. Kristina Sofia","female","37","0","0","4135","9.5875","","S","","","" -"3","0","Laleff, Mr. Kristo","male","","0","0","349217","7.8958","","S","","","" -"3","1","Lam, Mr. Ali","male","","0","0","1601","56.4958","","S","C","","" -"3","0","Lam, Mr. Len","male","","0","0","1601","56.4958","","S","","","" -"3","1","Landergren, Miss. Aurora Adelia","female","22","0","0","C 7077","7.25","","S","13","","" -"3","0","Lane, Mr. Patrick","male","","0","0","7935","7.75","","Q","","","" -"3","1","Lang, Mr. Fang","male","26","0","0","1601","56.4958","","S","14","","" -"3","0","Larsson, Mr. August Viktor","male","29","0","0","7545","9.4833","","S","","","" -"3","0","Larsson, Mr. Bengt Edvin","male","29","0","0","347067","7.775","","S","","","" -"3","0","Larsson-Rondberg, Mr. Edvard A","male","22","0","0","347065","7.775","","S","","","" -"3","1","Leeni, Mr. Fahim (""Philip Zenni"")","male","22","0","0","2620","7.225","","C","6","","" -"3","0","Lefebre, Master. Henry Forbes","male","","3","1","4133","25.4667","","S","","","" -"3","0","Lefebre, Miss. Ida","female","","3","1","4133","25.4667","","S","","","" -"3","0","Lefebre, Miss. Jeannie","female","","3","1","4133","25.4667","","S","","","" -"3","0","Lefebre, Miss. Mathilde","female","","3","1","4133","25.4667","","S","","","" -"3","0","Lefebre, Mrs. Frank (Frances)","female","","0","4","4133","25.4667","","S","","","" -"3","0","Leinonen, Mr. Antti Gustaf","male","32","0","0","STON/O 2. 3101292","7.925","","S","","","" -"3","0","Lemberopolous, Mr. Peter L","male","34.5","0","0","2683","6.4375","","C","","196","" -"3","0","Lennon, Miss. Mary","female","","1","0","370371","15.5","","Q","","","" -"3","0","Lennon, Mr. Denis","male","","1","0","370371","15.5","","Q","","","" -"3","0","Leonard, Mr. Lionel","male","36","0","0","LINE","0","","S","","","" -"3","0","Lester, Mr. James","male","39","0","0","A/4 48871","24.15","","S","","","" -"3","0","Lievens, Mr. Rene Aime","male","24","0","0","345781","9.5","","S","","","" -"3","0","Lindahl, Miss. Agda Thorilda Viktoria","female","25","0","0","347071","7.775","","S","","","" -"3","0","Lindblom, Miss. Augusta Charlotta","female","45","0","0","347073","7.75","","S","","","" -"3","0","Lindell, Mr. Edvard Bengtsson","male","36","1","0","349910","15.55","","S","A","","" -"3","0","Lindell, Mrs. Edvard Bengtsson (Elin Gerda Persson)","female","30","1","0","349910","15.55","","S","A","","" -"3","1","Lindqvist, Mr. Eino William","male","20","1","0","STON/O 2. 3101285","7.925","","S","15","","" -"3","0","Linehan, Mr. Michael","male","","0","0","330971","7.8792","","Q","","","" -"3","0","Ling, Mr. Lee","male","28","0","0","1601","56.4958","","S","","","" -"3","0","Lithman, Mr. Simon","male","","0","0","S.O./P.P. 251","7.55","","S","","","" -"3","0","Lobb, Mr. William Arthur","male","30","1","0","A/5. 3336","16.1","","S","","","" -"3","0","Lobb, Mrs. William Arthur (Cordelia K Stanlick)","female","26","1","0","A/5. 3336","16.1","","S","","","" -"3","0","Lockyer, Mr. Edward","male","","0","0","1222","7.8792","","S","","153","" -"3","0","Lovell, Mr. John Hall (""Henry"")","male","20.5","0","0","A/5 21173","7.25","","S","","","" -"3","1","Lulic, Mr. Nikola","male","27","0","0","315098","8.6625","","S","15","","" -"3","0","Lundahl, Mr. Johan Svensson","male","51","0","0","347743","7.0542","","S","","","" -"3","1","Lundin, Miss. Olga Elida","female","23","0","0","347469","7.8542","","S","10","","" -"3","1","Lundstrom, Mr. Thure Edvin","male","32","0","0","350403","7.5792","","S","15","","" -"3","0","Lyntakoff, Mr. Stanko","male","","0","0","349235","7.8958","","S","","","" -"3","0","MacKay, Mr. George William","male","","0","0","C.A. 42795","7.55","","S","","","" -"3","1","Madigan, Miss. Margaret ""Maggie""","female","","0","0","370370","7.75","","Q","15","","" -"3","1","Madsen, Mr. Fridtjof Arne","male","24","0","0","C 17369","7.1417","","S","13","","" -"3","0","Maenpaa, Mr. Matti Alexanteri","male","22","0","0","STON/O 2. 3101275","7.125","","S","","","" -"3","0","Mahon, Miss. Bridget Delia","female","","0","0","330924","7.8792","","Q","","","" -"3","0","Mahon, Mr. John","male","","0","0","AQ/4 3130","7.75","","Q","","","" -"3","0","Maisner, Mr. Simon","male","","0","0","A/S 2816","8.050000000000001","","S","","","" -"3","0","Makinen, Mr. Kalle Edvard","male","29","0","0","STON/O 2. 3101268","7.925","","S","","","" -"3","1","Mamee, Mr. Hanna","male","","0","0","2677","7.2292","","C","15","","" -"3","0","Mangan, Miss. Mary","female","30.5","0","0","364850","7.75","","Q","","61","" -"3","1","Mannion, Miss. Margareth","female","","0","0","36866","7.7375","","Q","16","","" -"3","0","Mardirosian, Mr. Sarkis","male","","0","0","2655","7.2292","F E46","C","","","" -"3","0","Markoff, Mr. Marin","male","35","0","0","349213","7.8958","","C","","","" -"3","0","Markun, Mr. Johann","male","33","0","0","349257","7.8958","","S","","","" -"3","1","Masselmani, Mrs. Fatima","female","","0","0","2649","7.225","","C","C","","" -"3","0","Matinoff, Mr. Nicola","male","","0","0","349255","7.8958","","C","","","" -"3","1","McCarthy, Miss. Catherine ""Katie""","female","","0","0","383123","7.75","","Q","15 16","","" -"3","1","McCormack, Mr. Thomas Joseph","male","","0","0","367228","7.75","","Q","","","" -"3","1","McCoy, Miss. Agnes","female","","2","0","367226","23.25","","Q","16","","" -"3","1","McCoy, Miss. Alicia","female","","2","0","367226","23.25","","Q","16","","" -"3","1","McCoy, Mr. Bernard","male","","2","0","367226","23.25","","Q","16","","" -"3","1","McDermott, Miss. Brigdet Delia","female","","0","0","330932","7.7875","","Q","13","","" -"3","0","McEvoy, Mr. Michael","male","","0","0","36568","15.5","","Q","","","" -"3","1","McGovern, Miss. Mary","female","","0","0","330931","7.8792","","Q","13","","" -"3","1","McGowan, Miss. Anna ""Annie""","female","15","0","0","330923","8.029199999999999","","Q","","","" -"3","0","McGowan, Miss. Katherine","female","35","0","0","9232","7.75","","Q","","","" -"3","0","McMahon, Mr. Martin","male","","0","0","370372","7.75","","Q","","","" -"3","0","McNamee, Mr. Neal","male","24","1","0","376566","16.1","","S","","","" -"3","0","McNamee, Mrs. Neal (Eileen O'Leary)","female","19","1","0","376566","16.1","","S","","53","" -"3","0","McNeill, Miss. Bridget","female","","0","0","370368","7.75","","Q","","","" -"3","0","Meanwell, Miss. (Marion Ogden)","female","","0","0","SOTON/O.Q. 392087","8.050000000000001","","S","","","" -"3","0","Meek, Mrs. Thomas (Annie Louise Rowley)","female","","0","0","343095","8.050000000000001","","S","","","" -"3","0","Meo, Mr. Alfonzo","male","55.5","0","0","A.5. 11206","8.050000000000001","","S","","201","" -"3","0","Mernagh, Mr. Robert","male","","0","0","368703","7.75","","Q","","","" -"3","1","Midtsjo, Mr. Karl Albert","male","21","0","0","345501","7.775","","S","15","","" -"3","0","Miles, Mr. Frank","male","","0","0","359306","8.050000000000001","","S","","","" -"3","0","Mineff, Mr. Ivan","male","24","0","0","349233","7.8958","","S","","","" -"3","0","Minkoff, Mr. Lazar","male","21","0","0","349211","7.8958","","S","","","" -"3","0","Mionoff, Mr. Stoytcho","male","28","0","0","349207","7.8958","","S","","","" -"3","0","Mitkoff, Mr. Mito","male","","0","0","349221","7.8958","","S","","","" -"3","1","Mockler, Miss. Helen Mary ""Ellie""","female","","0","0","330980","7.8792","","Q","16","","" -"3","0","Moen, Mr. Sigurd Hansen","male","25","0","0","348123","7.65","F G73","S","","309","" -"3","1","Moor, Master. Meier","male","6","0","1","392096","12.475","E121","S","14","","" -"3","1","Moor, Mrs. (Beila)","female","27","0","1","392096","12.475","E121","S","14","","" -"3","0","Moore, Mr. Leonard Charles","male","","0","0","A4. 54510","8.050000000000001","","S","","","" -"3","1","Moran, Miss. Bertha","female","","1","0","371110","24.15","","Q","16","","" -"3","0","Moran, Mr. Daniel J","male","","1","0","371110","24.15","","Q","","","" -"3","0","Moran, Mr. James","male","","0","0","330877","8.458299999999999","","Q","","","" -"3","0","Morley, Mr. William","male","34","0","0","364506","8.050000000000001","","S","","","" -"3","0","Morrow, Mr. Thomas Rowan","male","","0","0","372622","7.75","","Q","","","" -"3","1","Moss, Mr. Albert Johan","male","","0","0","312991","7.775","","S","B","","" -"3","1","Moubarek, Master. Gerios","male","","1","1","2661","15.2458","","C","C","","" -"3","1","Moubarek, Master. Halim Gonios (""William George"")","male","","1","1","2661","15.2458","","C","C","","" -"3","1","Moubarek, Mrs. George (Omine ""Amenia"" Alexander)","female","","0","2","2661","15.2458","","C","C","","" -"3","1","Moussa, Mrs. (Mantoura Boulos)","female","","0","0","2626","7.2292","","C","","","" -"3","0","Moutal, Mr. Rahamin Haim","male","","0","0","374746","8.050000000000001","","S","","","" -"3","1","Mullens, Miss. Katherine ""Katie""","female","","0","0","35852","7.7333","","Q","16","","" -"3","1","Mulvihill, Miss. Bertha E","female","24","0","0","382653","7.75","","Q","15","","" -"3","0","Murdlin, Mr. Joseph","male","","0","0","A./5. 3235","8.050000000000001","","S","","","" -"3","1","Murphy, Miss. Katherine ""Kate""","female","","1","0","367230","15.5","","Q","16","","" -"3","1","Murphy, Miss. Margaret Jane","female","","1","0","367230","15.5","","Q","16","","" -"3","1","Murphy, Miss. Nora","female","","0","0","36568","15.5","","Q","16","","" -"3","0","Myhrman, Mr. Pehr Fabian Oliver Malkolm","male","18","0","0","347078","7.75","","S","","","" -"3","0","Naidenoff, Mr. Penko","male","22","0","0","349206","7.8958","","S","","","" -"3","1","Najib, Miss. Adele Kiamie ""Jane""","female","15","0","0","2667","7.225","","C","C","","" -"3","1","Nakid, Miss. Maria (""Mary"")","female","1","0","2","2653","15.7417","","C","C","","" -"3","1","Nakid, Mr. Sahid","male","20","1","1","2653","15.7417","","C","C","","" -"3","1","Nakid, Mrs. Said (Waika ""Mary"" Mowad)","female","19","1","1","2653","15.7417","","C","C","","" -"3","0","Nancarrow, Mr. William Henry","male","33","0","0","A./5. 3338","8.050000000000001","","S","","","" -"3","0","Nankoff, Mr. Minko","male","","0","0","349218","7.8958","","S","","","" -"3","0","Nasr, Mr. Mustafa","male","","0","0","2652","7.2292","","C","","","" -"3","0","Naughton, Miss. Hannah","female","","0","0","365237","7.75","","Q","","","" -"3","0","Nenkoff, Mr. Christo","male","","0","0","349234","7.8958","","S","","","" -"3","1","Nicola-Yarred, Master. Elias","male","12","1","0","2651","11.2417","","C","C","","" -"3","1","Nicola-Yarred, Miss. Jamila","female","14","1","0","2651","11.2417","","C","C","","" -"3","0","Nieminen, Miss. Manta Josefina","female","29","0","0","3101297","7.925","","S","","","" -"3","0","Niklasson, Mr. Samuel","male","28","0","0","363611","8.050000000000001","","S","","","" -"3","1","Nilsson, Miss. Berta Olivia","female","18","0","0","347066","7.775","","S","D","","" -"3","1","Nilsson, Miss. Helmina Josefina","female","26","0","0","347470","7.8542","","S","13","","" -"3","0","Nilsson, Mr. August Ferdinand","male","21","0","0","350410","7.8542","","S","","","" -"3","0","Nirva, Mr. Iisakki Antino Aijo","male","41","0","0","SOTON/O2 3101272","7.125","","S","","","Finland Sudbury, ON" -"3","1","Niskanen, Mr. Juha","male","39","0","0","STON/O 2. 3101289","7.925","","S","9","","" -"3","0","Nosworthy, Mr. Richard Cater","male","21","0","0","A/4. 39886","7.8","","S","","","" -"3","0","Novel, Mr. Mansouer","male","28.5","0","0","2697","7.2292","","C","","181","" -"3","1","Nysten, Miss. Anna Sofia","female","22","0","0","347081","7.75","","S","13","","" -"3","0","Nysveen, Mr. Johan Hansen","male","61","0","0","345364","6.2375","","S","","","" -"3","0","O'Brien, Mr. Thomas","male","","1","0","370365","15.5","","Q","","","" -"3","0","O'Brien, Mr. Timothy","male","","0","0","330979","7.8292","","Q","","","" -"3","1","O'Brien, Mrs. Thomas (Johanna ""Hannah"" Godfrey)","female","","1","0","370365","15.5","","Q","","","" -"3","0","O'Connell, Mr. Patrick D","male","","0","0","334912","7.7333","","Q","","","" -"3","0","O'Connor, Mr. Maurice","male","","0","0","371060","7.75","","Q","","","" -"3","0","O'Connor, Mr. Patrick","male","","0","0","366713","7.75","","Q","","","" -"3","0","Odahl, Mr. Nils Martin","male","23","0","0","7267","9.225","","S","","","" -"3","0","O'Donoghue, Ms. Bridget","female","","0","0","364856","7.75","","Q","","","" -"3","1","O'Driscoll, Miss. Bridget","female","","0","0","14311","7.75","","Q","D","","" -"3","1","O'Dwyer, Miss. Ellen ""Nellie""","female","","0","0","330959","7.8792","","Q","","","" -"3","1","Ohman, Miss. Velin","female","22","0","0","347085","7.775","","S","C","","" -"3","1","O'Keefe, Mr. Patrick","male","","0","0","368402","7.75","","Q","B","","" -"3","1","O'Leary, Miss. Hanora ""Norah""","female","","0","0","330919","7.8292","","Q","13","","" -"3","1","Olsen, Master. Artur Karl","male","9","0","1","C 17368","3.1708","","S","13","","" -"3","0","Olsen, Mr. Henry Margido","male","28","0","0","C 4001","22.525","","S","","173","" -"3","0","Olsen, Mr. Karl Siegwart Andreas","male","42","0","1","4579","8.404199999999999","","S","","","" -"3","0","Olsen, Mr. Ole Martin","male","","0","0","Fa 265302","7.3125","","S","","","" -"3","0","Olsson, Miss. Elina","female","31","0","0","350407","7.8542","","S","","","" -"3","0","Olsson, Mr. Nils Johan Goransson","male","28","0","0","347464","7.8542","","S","","","" -"3","1","Olsson, Mr. Oscar Wilhelm","male","32","0","0","347079","7.775","","S","A","","" -"3","0","Olsvigen, Mr. Thor Anderson","male","20","0","0","6563","9.225","","S","","89","Oslo, Norway Cameron, WI" -"3","0","Oreskovic, Miss. Jelka","female","23","0","0","315085","8.6625","","S","","","" -"3","0","Oreskovic, Miss. Marija","female","20","0","0","315096","8.6625","","S","","","" -"3","0","Oreskovic, Mr. Luka","male","20","0","0","315094","8.6625","","S","","","" -"3","0","Osen, Mr. Olaf Elon","male","16","0","0","7534","9.216699999999999","","S","","","" -"3","1","Osman, Mrs. Mara","female","31","0","0","349244","8.683299999999999","","S","","","" -"3","0","O'Sullivan, Miss. Bridget Mary","female","","0","0","330909","7.6292","","Q","","","" -"3","0","Palsson, Master. Gosta Leonard","male","2","3","1","349909","21.075","","S","","4","" -"3","0","Palsson, Master. Paul Folke","male","6","3","1","349909","21.075","","S","","","" -"3","0","Palsson, Miss. Stina Viola","female","3","3","1","349909","21.075","","S","","","" -"3","0","Palsson, Miss. Torborg Danira","female","8","3","1","349909","21.075","","S","","","" -"3","0","Palsson, Mrs. Nils (Alma Cornelia Berglund)","female","29","0","4","349909","21.075","","S","","206","" -"3","0","Panula, Master. Eino Viljami","male","1","4","1","3101295","39.6875","","S","","","" -"3","0","Panula, Master. Juha Niilo","male","7","4","1","3101295","39.6875","","S","","","" -"3","0","Panula, Master. Urho Abraham","male","2","4","1","3101295","39.6875","","S","","","" -"3","0","Panula, Mr. Ernesti Arvid","male","16","4","1","3101295","39.6875","","S","","","" -"3","0","Panula, Mr. Jaako Arnold","male","14","4","1","3101295","39.6875","","S","","","" -"3","0","Panula, Mrs. Juha (Maria Emilia Ojala)","female","41","0","5","3101295","39.6875","","S","","","" -"3","0","Pasic, Mr. Jakob","male","21","0","0","315097","8.6625","","S","","","" -"3","0","Patchett, Mr. George","male","19","0","0","358585","14.5","","S","","","" -"3","0","Paulner, Mr. Uscher","male","","0","0","3411","8.7125","","C","","","" -"3","0","Pavlovic, Mr. Stefo","male","32","0","0","349242","7.8958","","S","","","" -"3","0","Peacock, Master. Alfred Edward","male","0.75","1","1","SOTON/O.Q. 3101315","13.775","","S","","","" -"3","0","Peacock, Miss. Treasteall","female","3","1","1","SOTON/O.Q. 3101315","13.775","","S","","","" -"3","0","Peacock, Mrs. Benjamin (Edith Nile)","female","26","0","2","SOTON/O.Q. 3101315","13.775","","S","","","" -"3","0","Pearce, Mr. Ernest","male","","0","0","343271","7","","S","","","" -"3","0","Pedersen, Mr. Olaf","male","","0","0","345498","7.775","","S","","","" -"3","0","Peduzzi, Mr. Joseph","male","","0","0","A/5 2817","8.050000000000001","","S","","","" -"3","0","Pekoniemi, Mr. Edvard","male","21","0","0","STON/O 2. 3101294","7.925","","S","","","" -"3","0","Peltomaki, Mr. Nikolai Johannes","male","25","0","0","STON/O 2. 3101291","7.925","","S","","","" -"3","0","Perkin, Mr. John Henry","male","22","0","0","A/5 21174","7.25","","S","","","" -"3","1","Persson, Mr. Ernst Ulrik","male","25","1","0","347083","7.775","","S","15","","" -"3","1","Peter, Master. Michael J","male","","1","1","2668","22.3583","","C","C","","" -"3","1","Peter, Miss. Anna","female","","1","1","2668","22.3583","F E69","C","D","","" -"3","1","Peter, Mrs. Catherine (Catherine Rizk)","female","","0","2","2668","22.3583","","C","D","","" -"3","0","Peters, Miss. Katie","female","","0","0","330935","8.137499999999999","","Q","","","" -"3","0","Petersen, Mr. Marius","male","24","0","0","342441","8.050000000000001","","S","","","" -"3","0","Petranec, Miss. Matilda","female","28","0","0","349245","7.8958","","S","","","" -"3","0","Petroff, Mr. Nedelio","male","19","0","0","349212","7.8958","","S","","","" -"3","0","Petroff, Mr. Pastcho (""Pentcho"")","male","","0","0","349215","7.8958","","S","","","" -"3","0","Petterson, Mr. Johan Emil","male","25","1","0","347076","7.775","","S","","","" -"3","0","Pettersson, Miss. Ellen Natalia","female","18","0","0","347087","7.775","","S","","","" -"3","1","Pickard, Mr. Berk (Berk Trembisky)","male","32","0","0","SOTON/O.Q. 392078","8.050000000000001","E10","S","9","","" -"3","0","Plotcharsky, Mr. Vasil","male","","0","0","349227","7.8958","","S","","","" -"3","0","Pokrnic, Mr. Mate","male","17","0","0","315095","8.6625","","S","","","" -"3","0","Pokrnic, Mr. Tome","male","24","0","0","315092","8.6625","","S","","","" -"3","0","Radeff, Mr. Alexander","male","","0","0","349223","7.8958","","S","","","" -"3","0","Rasmussen, Mrs. (Lena Jacobsen Solvang)","female","","0","0","65305","8.112500000000001","","S","","","" -"3","0","Razi, Mr. Raihed","male","","0","0","2629","7.2292","","C","","","" -"3","0","Reed, Mr. James George","male","","0","0","362316","7.25","","S","","","" -"3","0","Rekic, Mr. Tido","male","38","0","0","349249","7.8958","","S","","","" -"3","0","Reynolds, Mr. Harold J","male","21","0","0","342684","8.050000000000001","","S","","","" -"3","0","Rice, Master. Albert","male","10","4","1","382652","29.125","","Q","","","" -"3","0","Rice, Master. Arthur","male","4","4","1","382652","29.125","","Q","","","" -"3","0","Rice, Master. Eric","male","7","4","1","382652","29.125","","Q","","","" -"3","0","Rice, Master. Eugene","male","2","4","1","382652","29.125","","Q","","","" -"3","0","Rice, Master. George Hugh","male","8","4","1","382652","29.125","","Q","","","" -"3","0","Rice, Mrs. William (Margaret Norton)","female","39","0","5","382652","29.125","","Q","","327","" -"3","0","Riihivouri, Miss. Susanna Juhantytar ""Sanni""","female","22","0","0","3101295","39.6875","","S","","","" -"3","0","Rintamaki, Mr. Matti","male","35","0","0","STON/O 2. 3101273","7.125","","S","","","" -"3","1","Riordan, Miss. Johanna ""Hannah""","female","","0","0","334915","7.7208","","Q","13","","" -"3","0","Risien, Mr. Samuel Beard","male","","0","0","364498","14.5","","S","","","" -"3","0","Risien, Mrs. Samuel (Emma)","female","","0","0","364498","14.5","","S","","","" -"3","0","Robins, Mr. Alexander A","male","50","1","0","A/5. 3337","14.5","","S","","119","" -"3","0","Robins, Mrs. Alexander A (Grace Charity Laury)","female","47","1","0","A/5. 3337","14.5","","S","","7","" -"3","0","Rogers, Mr. William John","male","","0","0","S.C./A.4. 23567","8.050000000000001","","S","","","" -"3","0","Rommetvedt, Mr. Knud Paust","male","","0","0","312993","7.775","","S","","","" -"3","0","Rosblom, Miss. Salli Helena","female","2","1","1","370129","20.2125","","S","","","" -"3","0","Rosblom, Mr. Viktor Richard","male","18","1","1","370129","20.2125","","S","","","" -"3","0","Rosblom, Mrs. Viktor (Helena Wilhelmina)","female","41","0","2","370129","20.2125","","S","","","" -"3","1","Roth, Miss. Sarah A","female","","0","0","342712","8.050000000000001","","S","C","","" -"3","0","Rouse, Mr. Richard Henry","male","50","0","0","A/5 3594","8.050000000000001","","S","","","" -"3","0","Rush, Mr. Alfred George John","male","16","0","0","A/4. 20589","8.050000000000001","","S","","","" -"3","1","Ryan, Mr. Edward","male","","0","0","383162","7.75","","Q","14","","" -"3","0","Ryan, Mr. Patrick","male","","0","0","371110","24.15","","Q","","","" -"3","0","Saad, Mr. Amin","male","","0","0","2671","7.2292","","C","","","" -"3","0","Saad, Mr. Khalil","male","25","0","0","2672","7.225","","C","","","" -"3","0","Saade, Mr. Jean Nassr","male","","0","0","2676","7.225","","C","","","" -"3","0","Sadlier, Mr. Matthew","male","","0","0","367655","7.7292","","Q","","","" -"3","0","Sadowitz, Mr. Harry","male","","0","0","LP 1588","7.575","","S","","","" -"3","0","Saether, Mr. Simon Sivertsen","male","38.5","0","0","SOTON/O.Q. 3101262","7.25","","S","","32","" -"3","0","Sage, Master. Thomas Henry","male","","8","2","CA. 2343","69.55","","S","","","" -"3","0","Sage, Master. William Henry","male","14.5","8","2","CA. 2343","69.55","","S","","67","" -"3","0","Sage, Miss. Ada","female","","8","2","CA. 2343","69.55","","S","","","" -"3","0","Sage, Miss. Constance Gladys","female","","8","2","CA. 2343","69.55","","S","","","" -"3","0","Sage, Miss. Dorothy Edith ""Dolly""","female","","8","2","CA. 2343","69.55","","S","","","" -"3","0","Sage, Miss. Stella Anna","female","","8","2","CA. 2343","69.55","","S","","","" -"3","0","Sage, Mr. Douglas Bullen","male","","8","2","CA. 2343","69.55","","S","","","" -"3","0","Sage, Mr. Frederick","male","","8","2","CA. 2343","69.55","","S","","","" -"3","0","Sage, Mr. George John Jr","male","","8","2","CA. 2343","69.55","","S","","","" -"3","0","Sage, Mr. John George","male","","1","9","CA. 2343","69.55","","S","","","" -"3","0","Sage, Mrs. John (Annie Bullen)","female","","1","9","CA. 2343","69.55","","S","","","" -"3","0","Salander, Mr. Karl Johan","male","24","0","0","7266","9.324999999999999","","S","","","" -"3","1","Salkjelsvik, Miss. Anna Kristine","female","21","0","0","343120","7.65","","S","C","","" -"3","0","Salonen, Mr. Johan Werner","male","39","0","0","3101296","7.925","","S","","","" -"3","0","Samaan, Mr. Elias","male","","2","0","2662","21.6792","","C","","","" -"3","0","Samaan, Mr. Hanna","male","","2","0","2662","21.6792","","C","","","" -"3","0","Samaan, Mr. Youssef","male","","2","0","2662","21.6792","","C","","","" -"3","1","Sandstrom, Miss. Beatrice Irene","female","1","1","1","PP 9549","16.7","G6","S","13","","" -"3","1","Sandstrom, Mrs. Hjalmar (Agnes Charlotta Bengtsson)","female","24","0","2","PP 9549","16.7","G6","S","13","","" -"3","1","Sandstrom, Miss. Marguerite Rut","female","4","1","1","PP 9549","16.7","G6","S","13","","" -"3","1","Sap, Mr. Julius","male","25","0","0","345768","9.5","","S","11","","" -"3","0","Saundercock, Mr. William Henry","male","20","0","0","A/5. 2151","8.050000000000001","","S","","","" -"3","0","Sawyer, Mr. Frederick Charles","male","24.5","0","0","342826","8.050000000000001","","S","","284","" -"3","0","Scanlan, Mr. James","male","","0","0","36209","7.725","","Q","","","" -"3","0","Sdycoff, Mr. Todor","male","","0","0","349222","7.8958","","S","","","" -"3","0","Shaughnessy, Mr. Patrick","male","","0","0","370374","7.75","","Q","","","" -"3","1","Sheerlinck, Mr. Jan Baptist","male","29","0","0","345779","9.5","","S","11","","" -"3","0","Shellard, Mr. Frederick William","male","","0","0","C.A. 6212","15.1","","S","","","" -"3","1","Shine, Miss. Ellen Natalia","female","","0","0","330968","7.7792","","Q","","","" -"3","0","Shorney, Mr. Charles Joseph","male","","0","0","374910","8.050000000000001","","S","","","" -"3","0","Simmons, Mr. John","male","","0","0","SOTON/OQ 392082","8.050000000000001","","S","","","" -"3","0","Sirayanian, Mr. Orsen","male","22","0","0","2669","7.2292","","C","","","" -"3","0","Sirota, Mr. Maurice","male","","0","0","392092","8.050000000000001","","S","","","" -"3","0","Sivic, Mr. Husein","male","40","0","0","349251","7.8958","","S","","","" -"3","0","Sivola, Mr. Antti Wilhelm","male","21","0","0","STON/O 2. 3101280","7.925","","S","","","" -"3","1","Sjoblom, Miss. Anna Sofia","female","18","0","0","3101265","7.4958","","S","16","","" -"3","0","Skoog, Master. Harald","male","4","3","2","347088","27.9","","S","","","" -"3","0","Skoog, Master. Karl Thorsten","male","10","3","2","347088","27.9","","S","","","" -"3","0","Skoog, Miss. Mabel","female","9","3","2","347088","27.9","","S","","","" -"3","0","Skoog, Miss. Margit Elizabeth","female","2","3","2","347088","27.9","","S","","","" -"3","0","Skoog, Mr. Wilhelm","male","40","1","4","347088","27.9","","S","","","" -"3","0","Skoog, Mrs. William (Anna Bernhardina Karlsson)","female","45","1","4","347088","27.9","","S","","","" -"3","0","Slabenoff, Mr. Petco","male","","0","0","349214","7.8958","","S","","","" -"3","0","Slocovski, Mr. Selman Francis","male","","0","0","SOTON/OQ 392086","8.050000000000001","","S","","","" -"3","0","Smiljanic, Mr. Mile","male","","0","0","315037","8.6625","","S","","","" -"3","0","Smith, Mr. Thomas","male","","0","0","384461","7.75","","Q","","","" -"3","1","Smyth, Miss. Julia","female","","0","0","335432","7.7333","","Q","13","","" -"3","0","Soholt, Mr. Peter Andreas Lauritz Andersen","male","19","0","0","348124","7.65","F G73","S","","","" -"3","0","Somerton, Mr. Francis William","male","30","0","0","A.5. 18509","8.050000000000001","","S","","","" -"3","0","Spector, Mr. Woolf","male","","0","0","A.5. 3236","8.050000000000001","","S","","","" -"3","0","Spinner, Mr. Henry John","male","32","0","0","STON/OQ. 369943","8.050000000000001","","S","","","" -"3","0","Staneff, Mr. Ivan","male","","0","0","349208","7.8958","","S","","","" -"3","0","Stankovic, Mr. Ivan","male","33","0","0","349239","8.6625","","C","","","" -"3","1","Stanley, Miss. Amy Zillah Elsie","female","23","0","0","CA. 2314","7.55","","S","C","","" -"3","0","Stanley, Mr. Edward Roland","male","21","0","0","A/4 45380","8.050000000000001","","S","","","" -"3","0","Storey, Mr. Thomas","male","60.5","0","0","3701","","","S","","261","" -"3","0","Stoytcheff, Mr. Ilia","male","19","0","0","349205","7.8958","","S","","","" -"3","0","Strandberg, Miss. Ida Sofia","female","22","0","0","7553","9.8375","","S","","","" -"3","1","Stranden, Mr. Juho","male","31","0","0","STON/O 2. 3101288","7.925","","S","9","","" -"3","0","Strilic, Mr. Ivan","male","27","0","0","315083","8.6625","","S","","","" -"3","0","Strom, Miss. Telma Matilda","female","2","0","1","347054","10.4625","G6","S","","","" -"3","0","Strom, Mrs. Wilhelm (Elna Matilda Persson)","female","29","1","1","347054","10.4625","G6","S","","","" -"3","1","Sunderland, Mr. Victor Francis","male","16","0","0","SOTON/OQ 392089","8.050000000000001","","S","B","","" -"3","1","Sundman, Mr. Johan Julian","male","44","0","0","STON/O 2. 3101269","7.925","","S","15","","" -"3","0","Sutehall, Mr. Henry Jr","male","25","0","0","SOTON/OQ 392076","7.05","","S","","","" -"3","0","Svensson, Mr. Johan","male","74","0","0","347060","7.775","","S","","","" -"3","1","Svensson, Mr. Johan Cervin","male","14","0","0","7538","9.225","","S","13","","" -"3","0","Svensson, Mr. Olof","male","24","0","0","350035","7.7958","","S","","","" -"3","1","Tenglin, Mr. Gunnar Isidor","male","25","0","0","350033","7.7958","","S","13 15","","" -"3","0","Theobald, Mr. Thomas Leonard","male","34","0","0","363294","8.050000000000001","","S","","176","" -"3","1","Thomas, Master. Assad Alexander","male","0.4167","0","1","2625","8.5167","","C","16","","" -"3","0","Thomas, Mr. Charles P","male","","1","0","2621","6.4375","","C","","","" -"3","0","Thomas, Mr. John","male","","0","0","2681","6.4375","","C","","","" -"3","0","Thomas, Mr. Tannous","male","","0","0","2684","7.225","","C","","","" -"3","1","Thomas, Mrs. Alexander (Thamine ""Thelma"")","female","16","1","1","2625","8.5167","","C","14","","" -"3","0","Thomson, Mr. Alexander Morrison","male","","0","0","32302","8.050000000000001","","S","","","" -"3","0","Thorneycroft, Mr. Percival","male","","1","0","376564","16.1","","S","","","" -"3","1","Thorneycroft, Mrs. Percival (Florence Kate White)","female","","1","0","376564","16.1","","S","10","","" -"3","0","Tikkanen, Mr. Juho","male","32","0","0","STON/O 2. 3101293","7.925","","S","","","" -"3","0","Tobin, Mr. Roger","male","","0","0","383121","7.75","F38","Q","","","" -"3","0","Todoroff, Mr. Lalio","male","","0","0","349216","7.8958","","S","","","" -"3","0","Tomlin, Mr. Ernest Portage","male","30.5","0","0","364499","8.050000000000001","","S","","50","" -"3","0","Torber, Mr. Ernst William","male","44","0","0","364511","8.050000000000001","","S","","","" -"3","0","Torfa, Mr. Assad","male","","0","0","2673","7.2292","","C","","","" -"3","1","Tornquist, Mr. William Henry","male","25","0","0","LINE","0","","S","15","","" -"3","0","Toufik, Mr. Nakli","male","","0","0","2641","7.2292","","C","","","" -"3","1","Touma, Master. Georges Youssef","male","7","1","1","2650","15.2458","","C","C","","" -"3","1","Touma, Miss. Maria Youssef","female","9","1","1","2650","15.2458","","C","C","","" -"3","1","Touma, Mrs. Darwis (Hanne Youssef Razi)","female","29","0","2","2650","15.2458","","C","C","","" -"3","0","Turcin, Mr. Stjepan","male","36","0","0","349247","7.8958","","S","","","" -"3","1","Turja, Miss. Anna Sofia","female","18","0","0","4138","9.841699999999999","","S","15","","" -"3","1","Turkula, Mrs. (Hedwig)","female","63","0","0","4134","9.5875","","S","15","","" -"3","0","van Billiard, Master. James William","male","","1","1","A/5. 851","14.5","","S","","","" -"3","0","van Billiard, Master. Walter John","male","11.5","1","1","A/5. 851","14.5","","S","","1","" -"3","0","van Billiard, Mr. Austin Blyler","male","40.5","0","2","A/5. 851","14.5","","S","","255","" -"3","0","Van Impe, Miss. Catharina","female","10","0","2","345773","24.15","","S","","","" -"3","0","Van Impe, Mr. Jean Baptiste","male","36","1","1","345773","24.15","","S","","","" -"3","0","Van Impe, Mrs. Jean Baptiste (Rosalie Paula Govaert)","female","30","1","1","345773","24.15","","S","","","" -"3","0","van Melkebeke, Mr. Philemon","male","","0","0","345777","9.5","","S","","","" -"3","0","Vande Velde, Mr. Johannes Joseph","male","33","0","0","345780","9.5","","S","","","" -"3","0","Vande Walle, Mr. Nestor Cyriel","male","28","0","0","345770","9.5","","S","","","" -"3","0","Vanden Steen, Mr. Leo Peter","male","28","0","0","345783","9.5","","S","","","" -"3","0","Vander Cruyssen, Mr. Victor","male","47","0","0","345765","9","","S","","","" -"3","0","Vander Planke, Miss. Augusta Maria","female","18","2","0","345764","18","","S","","","" -"3","0","Vander Planke, Mr. Julius","male","31","3","0","345763","18","","S","","","" -"3","0","Vander Planke, Mr. Leo Edmondus","male","16","2","0","345764","18","","S","","","" -"3","0","Vander Planke, Mrs. Julius (Emelia Maria Vandemoortele)","female","31","1","0","345763","18","","S","","","" -"3","1","Vartanian, Mr. David","male","22","0","0","2658","7.225","","C","13 15","","" -"3","0","Vendel, Mr. Olof Edvin","male","20","0","0","350416","7.8542","","S","","","" -"3","0","Vestrom, Miss. Hulda Amanda Adolfina","female","14","0","0","350406","7.8542","","S","","","" -"3","0","Vovk, Mr. Janko","male","22","0","0","349252","7.8958","","S","","","" -"3","0","Waelens, Mr. Achille","male","22","0","0","345767","9","","S","","","Antwerp, Belgium / Stanton, OH" -"3","0","Ware, Mr. Frederick","male","","0","0","359309","8.050000000000001","","S","","","" -"3","0","Warren, Mr. Charles William","male","","0","0","C.A. 49867","7.55","","S","","","" -"3","0","Webber, Mr. James","male","","0","0","SOTON/OQ 3101316","8.050000000000001","","S","","","" -"3","0","Wenzel, Mr. Linhart","male","32.5","0","0","345775","9.5","","S","","298","" -"3","1","Whabee, Mrs. George Joseph (Shawneene Abi-Saab)","female","38","0","0","2688","7.2292","","C","C","","" -"3","0","Widegren, Mr. Carl/Charles Peter","male","51","0","0","347064","7.75","","S","","","" -"3","0","Wiklund, Mr. Jakob Alfred","male","18","1","0","3101267","6.4958","","S","","314","" -"3","0","Wiklund, Mr. Karl Johan","male","21","1","0","3101266","6.4958","","S","","","" -"3","1","Wilkes, Mrs. James (Ellen Needs)","female","47","1","0","363272","7","","S","","","" -"3","0","Willer, Mr. Aaron (""Abi Weller"")","male","","0","0","3410","8.7125","","S","","","" -"3","0","Willey, Mr. Edward","male","","0","0","S.O./P.P. 751","7.55","","S","","","" -"3","0","Williams, Mr. Howard Hugh ""Harry""","male","","0","0","A/5 2466","8.050000000000001","","S","","","" -"3","0","Williams, Mr. Leslie","male","28.5","0","0","54636","16.1","","S","","14","" -"3","0","Windelov, Mr. Einar","male","21","0","0","SOTON/OQ 3101317","7.25","","S","","","" -"3","0","Wirz, Mr. Albert","male","27","0","0","315154","8.6625","","S","","131","" -"3","0","Wiseman, Mr. Phillippe","male","","0","0","A/4. 34244","7.25","","S","","","" -"3","0","Wittevrongel, Mr. Camille","male","36","0","0","345771","9.5","","S","","","" -"3","0","Yasbeck, Mr. Antoni","male","27","1","0","2659","14.4542","","C","C","","" -"3","1","Yasbeck, Mrs. Antoni (Selini Alexander)","female","15","1","0","2659","14.4542","","C","","","" -"3","0","Youseff, Mr. Gerious","male","45.5","0","0","2628","7.225","","C","","312","" -"3","0","Yousif, Mr. Wazli","male","","0","0","2647","7.225","","C","","","" -"3","0","Yousseff, Mr. Gerious","male","","0","0","2627","14.4583","","C","","","" -"3","0","Zabour, Miss. Hileni","female","14.5","1","0","2665","14.4542","","C","","328","" -"3","0","Zabour, Miss. Thamine","female","","1","0","2665","14.4542","","C","","","" -"3","0","Zakarian, Mr. Mapriededer","male","26.5","0","0","2656","7.225","","C","","304","" -"3","0","Zakarian, Mr. Ortin","male","27","0","0","2670","7.225","","C","","","" -"3","0","Zimmerman, Mr. Leo","male","29","0","0","315082","7.875","","S","","","" From e89e8788b6dd0895b9eacd8f2b2ff367e5624288 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Sat, 25 Aug 2018 06:30:12 +0530 Subject: [PATCH 11/39] Delete Titanic-DataQuest.ipynb --- Titanic-DataQuest.ipynb | 2608 --------------------------------------- 1 file changed, 2608 deletions(-) delete mode 100644 Titanic-DataQuest.ipynb diff --git a/Titanic-DataQuest.ipynb b/Titanic-DataQuest.ipynb deleted file mode 100644 index b933e51..0000000 --- a/Titanic-DataQuest.ipynb +++ /dev/null @@ -1,2608 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 80, - "metadata": {}, - "outputs": [], - "source": [ - "import numpy as np\n", - "import pandas as pd\n", - "from sklearn.ensemble import RandomForestClassifier\n", - "from sklearn.cross_validation import train_test_split\n", - "from sklearn.externals import joblib\n", - "from sklearn.naive_bayes import GaussianNB\n", - "from sklearn.linear_model import LogisticRegression\n", - "import numpy as np\n", - "from sklearn.metrics import accuracy_score\n", - "from sklearn.model_selection import cross_val_score" - ] - }, - { - "cell_type": "code", - "execution_count": 81, - "metadata": {}, - "outputs": [], - "source": [ - "#Loading the complete File" - ] - }, - { - "cell_type": "code", - "execution_count": 82, - "metadata": {}, - "outputs": [], - "source": [ - "titanicCompleteData= pd.read_csv(\"C:/MyFolder/titanic.csv\")" - ] - }, - { - "cell_type": "code", - "execution_count": 83, - "metadata": {}, - "outputs": [], - "source": [ - "#In the file we have total 1310 records. From these records we have decided to keep 891 for training purpose." - ] - }, - { - "cell_type": "code", - "execution_count": 84, - "metadata": {}, - "outputs": [], - "source": [ - "trainData = titanicCompleteData.head(891)" - ] - }, - { - "cell_type": "code", - "execution_count": 85, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Dimensions of train: (891, 14)\n" - ] - } - ], - "source": [ - "print(\"Dimensions of train: {}\".format(trainData.shape))\n" - ] - }, - { - "cell_type": "code", - "execution_count": 86, - "metadata": {}, - "outputs": [], - "source": [ - "#The reamining 418 records will be used for testing purpose." - ] - }, - { - "cell_type": "code", - "execution_count": 87, - "metadata": {}, - "outputs": [], - "source": [ - "untouchedTestData = titanicCompleteData.tail(418)" - ] - }, - { - "cell_type": "code", - "execution_count": 88, - "metadata": {}, - "outputs": [], - "source": [ - "#From the test records, we are deleting the 'survived' columns.\n", - "#ONE THING IMPORTANT IS THAT WE ARE NOT DELETING FROM THE ACTUAL FILE BUT FROM THE DATAFRAME.\n", - "#ANOTHER IMPORTANT THING IS THAT- HERE WE HAVE ONE FILE WHICH WE HAVE DIVIDED INTO TWO DATAFRAMES.\n", - "#IF WE WERE GIVEN TWO FILES (TEST & TRAIN) WE COULD HAVE SIMPLY LOADED BOTH OF THEM INTO TWO DIFFERENT DATAFRAMES.\n", - "#ONE FILE | TWO FILE APPROACH MAKES NO DIFFERENCE ! " - ] - }, - { - "cell_type": "code", - "execution_count": 89, - "metadata": {}, - "outputs": [], - "source": [ - "del untouchedTestData['survived']" - ] - }, - { - "cell_type": "code", - "execution_count": 90, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Dimensions of test: (418, 13)\n" - ] - } - ], - "source": [ - "print(\"Dimensions of test: {}\".format(untouchedTestData.shape))" - ] - }, - { - "cell_type": "code", - "execution_count": 91, - "metadata": {}, - "outputs": [], - "source": [ - "#Pandas has a method called 'cut'. The method is used for segmenting into categories.\n", - "#We are planning to introduce a new column 'Age Categories' in the Training set.\n", - "#We will be using 'cut' method to segment the ages into defined categories.\n", - "#EXAMPLE:\n", - "#-1 - 0 = Missing\n", - "#0 - 5 = Infant\n", - "#5 - 12 = Child\n", - "#12 - 18 = Teenager\n", - "#18 - 35 = Young Adult\n", - "#35 - 60 = Adult\n", - "#60 - 100 = Senior" - ] - }, - { - "cell_type": "code", - "execution_count": 92, - "metadata": {}, - "outputs": [], - "source": [ - "def process_age(df,cut_points,label_names):\n", - " df[\"age\"] = df[\"age\"].fillna(-0.5)\n", - " df[\"Age_categories\"] = pd.cut(df[\"age\"],cut_points,labels=label_names)\n", - " return df\n" - ] - }, - { - "cell_type": "code", - "execution_count": 93, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:2: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " \n", - "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:3: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " This is separate from the ipykernel package so we can avoid doing imports until\n" - ] - } - ], - "source": [ - "cut_points = [-1,0,5,12,18,35,60,100]\n", - "label_names = [\"Missing\",\"Infant\",\"Child\",\"Teenager\",\"Young Adult\",\"Adult\",\"Senior\"]\n", - "\n", - "trainData = process_age(trainData,cut_points,label_names)\n", - "untouchedTestData = process_age(untouchedTestData,cut_points,label_names)" - ] - }, - { - "cell_type": "code", - "execution_count": 94, - "metadata": {}, - "outputs": [], - "source": [ - "#Notice that after the addition of new column 'Age Categories' the dimention changed from (891,14) ---> (891,15)\n", - "#AND (891,13) ---> (418,14)\n" - ] - }, - { - "cell_type": "code", - "execution_count": 95, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Dimensions of train: (891, 15)\n" - ] - } - ], - "source": [ - "print(\"Dimensions of train: {}\".format(trainData.shape))" - ] - }, - { - "cell_type": "code", - "execution_count": 96, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Dimensions of train: (418, 14)\n" - ] - } - ], - "source": [ - "print(\"Dimensions of train: {}\".format(untouchedTestData.shape))" - ] - }, - { - "cell_type": "code", - "execution_count": 97, - "metadata": {}, - "outputs": [], - "source": [ - "# Right now our Training Dataframe is of (891,15) dimention.\n", - "# and our Testing Dataframe is of (418, 14) dimention.\n", - "\n", - "#Now, we are going to introduce 7+3 columns (in both Training and Testing Dataframes)\n", - "#7 new columns will be for ages. Default values = 0 \n", - "#3 new columns will be for class.Default values = 0 " - ] - }, - { - "cell_type": "code", - "execution_count": 98, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:4: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " after removing the cwd from sys.path.\n", - "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:7: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " import sys\n", - "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:12: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " if sys.path[0] == '':\n", - "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:15: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " from ipykernel import kernelapp as app\n" - ] - } - ], - "source": [ - "new_age_columns = [\"Missing\",\"Infant\",\"Child\",\"Teenager\",\"Young Adult\",\"Adult\",\"Senior\"]\n", - "\n", - "for newCol in new_age_columns:\n", - " trainData[newCol] =0\n", - " \n", - "for newCol in new_age_columns:\n", - " untouchedTestData[newCol] =0\n", - " \n", - " \n", - "new_class_columns = [\"PClass1\", \"PClass2\", \"PClass3\"]\n", - "for newCCol in new_class_columns:\n", - " trainData[newCCol] =0\n", - " \n", - "for newCCol in new_class_columns:\n", - " untouchedTestData[newCCol] =0" - ] - }, - { - "cell_type": "code", - "execution_count": 99, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Dimensions of train: (891, 25)\n" - ] - } - ], - "source": [ - "print(\"Dimensions of train: {}\".format(trainData.shape))" - ] - }, - { - "cell_type": "code", - "execution_count": 100, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Dimensions of train: (418, 24)\n" - ] - } - ], - "source": [ - "print(\"Dimensions of train: {}\".format(untouchedTestData.shape))" - ] - }, - { - "cell_type": "code", - "execution_count": 101, - "metadata": {}, - "outputs": [], - "source": [ - "# In the mission of creating sparse matrix, we will also need to change the male-female as 1 and 0 (In both the Dataframes)" - ] - }, - { - "cell_type": "code", - "execution_count": 102, - "metadata": {}, - "outputs": [], - "source": [ - "trainData = trainData.replace({'sex':{'male':1,'female':0}})\n", - "untouchedTestData = untouchedTestData.replace({'sex':{'male':1,'female':0}})" - ] - }, - { - "cell_type": "code", - "execution_count": 103, - "metadata": {}, - "outputs": [], - "source": [ - "#Now as for 7+3 newly created columns we have assigned 0 as default values ; but that's not going to take things forward. We need to assign respective values into the same.\n", - "#Explanation:\n", - "#In Training set, if the value of column PClass = 1 then , for mark newly created PClass1 column value as 1, and rest 0.\n", - "#Similarly\n", - "#If the value of column PClass = 3 then , for mark newly created PClass3 column value as 1, and rest 0.\n", - "#...\n", - "#...\n", - "#...\n", - "\n", - "\n", - "#This is Sparse Matrix Way!" - ] - }, - { - "cell_type": "code", - "execution_count": 104, - "metadata": {}, - "outputs": [], - "source": [ - " \n", - "trainData['PClass1'] = np.where(trainData['pclass']==1, '1', '0')\n", - "trainData['PClass2'] = np.where(trainData['pclass']==2, '1', '0')\n", - "trainData['PClass3'] = np.where(trainData['pclass']==3, '1', '0')\n", - "\n", - "trainData['Missing'] = np.where(trainData['Age_categories']==\"Missing\", '1', '0')\n", - "trainData['Infant'] = np.where(trainData['Age_categories']=='Infant', '1', '0')\n", - "trainData['Child'] = np.where(trainData['Age_categories']=='Child', '1', '0')\n", - "trainData['Teenager'] = np.where(trainData['Age_categories']=='Teenager', '1', '0')\n", - "trainData['Young Adult'] = np.where(trainData['Age_categories']=='Young Adult', '1', '0')\n", - "trainData['Adult'] = np.where(trainData['Age_categories']=='Adult', '1', '0')\n", - "trainData['Senior'] = np.where(trainData['Age_categories']=='Senior', '1', '0')\n", - "\n", - "#=======================================================================================================\n", - "\n", - "untouchedTestData['PClass1'] = np.where(untouchedTestData['pclass']==1, '1', '0')\n", - "untouchedTestData['PClass2'] = np.where(untouchedTestData['pclass']==2, '1', '0')\n", - "untouchedTestData['PClass3'] = np.where(untouchedTestData['pclass']==3, '1', '0')\n", - "\n", - "untouchedTestData['Missing'] = np.where(untouchedTestData['Age_categories']==\"Missing\", '1', '0')\n", - "untouchedTestData['Infant'] = np.where(untouchedTestData['Age_categories']=='Infant', '1', '0')\n", - "untouchedTestData['Child'] = np.where(untouchedTestData['Age_categories']=='Child', '1', '0')\n", - "untouchedTestData['Teenager'] = np.where(untouchedTestData['Age_categories']=='Teenager', '1', '0')\n", - "untouchedTestData['Young Adult'] = np.where(untouchedTestData['Age_categories']=='Young Adult', '1', '0')\n", - "untouchedTestData['Adult'] = np.where(untouchedTestData['Age_categories']=='Adult', '1', '0')\n", - "untouchedTestData['Senior'] = np.where(untouchedTestData['Age_categories']=='Senior', '1', '0')\n" - ] - }, - { - "cell_type": "code", - "execution_count": 105, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
pclasssurvivednamesexagesibspparchticketfarecabin...MissingInfantChildTeenagerYoung AdultAdultSeniorPClass1PClass2PClass3
011Allen, Miss. Elisabeth Walton029.00000024160211.3375B5...0000100100
111Allison, Master. Hudson Trevor10.916712113781151.5500C22 C26...0100000100
210Allison, Miss. Helen Loraine02.000012113781151.5500C22 C26...0100000100
310Allison, Mr. Hudson Joshua Creighton130.000012113781151.5500C22 C26...0000100100
410Allison, Mrs. Hudson J C (Bessie Waldo Daniels)025.000012113781151.5500C22 C26...0000100100
511Anderson, Mr. Harry148.0000001995226.5500E12...0000010100
611Andrews, Miss. Kornelia Theodosia063.0000101350277.9583D7...0000001100
710Andrews, Mr. Thomas Jr139.0000001120500.0000A36...0000010100
811Appleton, Mrs. Edward Dale (Charlotte Lamson)053.0000201176951.4792C101...0000010100
910Artagaveytia, Mr. Ramon171.000000PC 1760949.5042NaN...0000001100
1010Astor, Col. John Jacob147.000010PC 17757227.5250C62 C64...0000010100
1111Astor, Mrs. John Jacob (Madeleine Talmadge Force)018.000010PC 17757227.5250C62 C64...0001000100
\n", - "

12 rows × 25 columns

\n", - "
" - ], - "text/plain": [ - " pclass survived name sex \\\n", - "0 1 1 Allen, Miss. Elisabeth Walton 0 \n", - "1 1 1 Allison, Master. Hudson Trevor 1 \n", - "2 1 0 Allison, Miss. Helen Loraine 0 \n", - "3 1 0 Allison, Mr. Hudson Joshua Creighton 1 \n", - "4 1 0 Allison, Mrs. Hudson J C (Bessie Waldo Daniels) 0 \n", - "5 1 1 Anderson, Mr. Harry 1 \n", - "6 1 1 Andrews, Miss. Kornelia Theodosia 0 \n", - "7 1 0 Andrews, Mr. Thomas Jr 1 \n", - "8 1 1 Appleton, Mrs. Edward Dale (Charlotte Lamson) 0 \n", - "9 1 0 Artagaveytia, Mr. Ramon 1 \n", - "10 1 0 Astor, Col. John Jacob 1 \n", - "11 1 1 Astor, Mrs. John Jacob (Madeleine Talmadge Force) 0 \n", - "\n", - " age sibsp parch ticket fare cabin ... Missing Infant \\\n", - "0 29.0000 0 0 24160 211.3375 B5 ... 0 0 \n", - "1 0.9167 1 2 113781 151.5500 C22 C26 ... 0 1 \n", - "2 2.0000 1 2 113781 151.5500 C22 C26 ... 0 1 \n", - "3 30.0000 1 2 113781 151.5500 C22 C26 ... 0 0 \n", - "4 25.0000 1 2 113781 151.5500 C22 C26 ... 0 0 \n", - "5 48.0000 0 0 19952 26.5500 E12 ... 0 0 \n", - "6 63.0000 1 0 13502 77.9583 D7 ... 0 0 \n", - "7 39.0000 0 0 112050 0.0000 A36 ... 0 0 \n", - "8 53.0000 2 0 11769 51.4792 C101 ... 0 0 \n", - "9 71.0000 0 0 PC 17609 49.5042 NaN ... 0 0 \n", - "10 47.0000 1 0 PC 17757 227.5250 C62 C64 ... 0 0 \n", - "11 18.0000 1 0 PC 17757 227.5250 C62 C64 ... 0 0 \n", - "\n", - " Child Teenager Young Adult Adult Senior PClass1 PClass2 PClass3 \n", - "0 0 0 1 0 0 1 0 0 \n", - "1 0 0 0 0 0 1 0 0 \n", - "2 0 0 0 0 0 1 0 0 \n", - "3 0 0 1 0 0 1 0 0 \n", - "4 0 0 1 0 0 1 0 0 \n", - "5 0 0 0 1 0 1 0 0 \n", - "6 0 0 0 0 1 1 0 0 \n", - "7 0 0 0 1 0 1 0 0 \n", - "8 0 0 0 1 0 1 0 0 \n", - "9 0 0 0 0 1 1 0 0 \n", - "10 0 0 0 1 0 1 0 0 \n", - "11 0 1 0 0 0 1 0 0 \n", - "\n", - "[12 rows x 25 columns]" - ] - }, - "execution_count": 105, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "trainData.head(12)" - ] - }, - { - "cell_type": "code", - "execution_count": 106, - "metadata": {}, - "outputs": [], - "source": [ - "#Now choose the important variables (columns)" - ] - }, - { - "cell_type": "code", - "execution_count": 107, - "metadata": {}, - "outputs": [], - "source": [ - "selectdColumns = [\"sex\",\"Missing\",\"Infant\",\"Child\",\"Teenager\",\"Young Adult\",\"Adult\",\"Senior\",\"PClass1\", \"PClass2\", \"PClass3\"]" - ] - }, - { - "cell_type": "code", - "execution_count": 108, - "metadata": {}, - "outputs": [], - "source": [ - "# Now we have Sparse Matrix is prepared, time to apply ML modeling." - ] - }, - { - "cell_type": "code", - "execution_count": 109, - "metadata": {}, - "outputs": [], - "source": [ - "#lr = LogisticRegression()" - ] - }, - { - "cell_type": "code", - "execution_count": 110, - "metadata": {}, - "outputs": [], - "source": [ - "#lr.fit(trainData[selectdColumns], trainData[\"survived\"])" - ] - }, - { - "cell_type": "code", - "execution_count": 111, - "metadata": {}, - "outputs": [], - "source": [ - "rf = RandomForestClassifier (n_estimators=100)" - ] - }, - { - "cell_type": "code", - "execution_count": 112, - "metadata": {}, - "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_impurity_decrease=0.0, min_impurity_split=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": 112, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "rf.fit(trainData[selectdColumns], trainData[\"survived\"])" - ] - }, - { - "cell_type": "code", - "execution_count": 113, - "metadata": {}, - "outputs": [], - "source": [ - "#IMPORTANT: NOW WE ARE SPLITTING OUR TRAIN DATAFRAME IN 80% 20% RATIO." - ] - }, - { - "cell_type": "code", - "execution_count": 114, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0\n", - " 0 1 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0\n", - " 0 0 1 0 0 1 0 1 0 0 0 0 1 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0\n", - " 0 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 1 0 1 1 0 1 0 0 1 1 0 0 0 0 1 0 0\n", - " 0 0 0 1 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0]\n", - "0.8100558659217877\n" - ] - } - ], - "source": [ - "all_X = trainData[selectdColumns]\n", - "all_y = trainData['survived']\n", - "\n", - "train_X, test_X, train_y, test_y = train_test_split(\n", - " all_X, all_y, test_size=0.20,random_state=0)\n", - "\n", - "rf.fit(train_X, train_y)\n", - "predictions = rf.predict(test_X)\n", - "print(predictions)\n", - "accuracy = accuracy_score(test_y, predictions)\n", - "print(accuracy)" - ] - }, - { - "cell_type": "code", - "execution_count": 115, - "metadata": {}, - "outputs": [], - "source": [ - "#10 FOLD CROSS VALIDATION- Therefore, 10 results in the List.\n", - "#Post that, taking mean of the calculated scores." - ] - }, - { - "cell_type": "code", - "execution_count": 116, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[0.56818182 0.60227273 0.75555556 0.77777778 0.80898876 0.80898876\n", - " 0.82222222 0.83333333 0.875 0.88764045]\n", - "0.7739961411871523\n" - ] - } - ], - "source": [ - "rf = RandomForestClassifier (n_estimators=100)\n", - "scores = cross_val_score(rf, all_X, all_y, cv=10)\n", - "scores.sort()\n", - "accuracy = scores.mean()\n", - "\n", - "print(scores)\n", - "print(accuracy)" - ] - }, - { - "cell_type": "code", - "execution_count": 122, - "metadata": {}, - "outputs": [], - "source": [ - "############ NOW TIME TO USE UNSEEN DATA #################" - ] - }, - { - "cell_type": "code", - "execution_count": 123, - "metadata": {}, - "outputs": [], - "source": [ - "holdout = untouchedTestData " - ] - }, - { - "cell_type": "code", - "execution_count": 124, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
sexMissingInfantChildTeenagerYoung AdultAdultSeniorPClass1PClass2PClass3
89110000100001
89210000100001
89310000100001
89410100000001
89500100000001
89610000010001
89710000100001
89810000100001
89900000100001
90011000000001
90101000000001
90211000000001
90301000000001
90410000100001
90510000100001
90610000100001
90700000100001
90800000100001
90910000100001
91010001000001
91110000100001
91210000100001
91310000100001
91410000100001
91510000100001
91600100000001
91710000010001
91811000000001
91910000100001
92011000000001
....................................
127900001000001
128010000100001
128110000100001
128211000000001
128311000000001
128411000000001
128510000100001
128600000010001
128710000010001
128810001000001
128910000100001
129000000010001
129111000000001
129211000000001
129311000000001
129410000100001
129510000100001
129610000100001
129711000000001
129810000010001
129910000100001
130000001000001
130110000010001
130211000000001
130311000000001
130400001000001
130501000000001
130610000100001
130710000100001
130810000100001
\n", - "

418 rows × 11 columns

\n", - "
" - ], - "text/plain": [ - " sex Missing Infant Child Teenager Young Adult Adult Senior PClass1 \\\n", - "891 1 0 0 0 0 1 0 0 0 \n", - "892 1 0 0 0 0 1 0 0 0 \n", - "893 1 0 0 0 0 1 0 0 0 \n", - "894 1 0 1 0 0 0 0 0 0 \n", - "895 0 0 1 0 0 0 0 0 0 \n", - "896 1 0 0 0 0 0 1 0 0 \n", - "897 1 0 0 0 0 1 0 0 0 \n", - "898 1 0 0 0 0 1 0 0 0 \n", - "899 0 0 0 0 0 1 0 0 0 \n", - "900 1 1 0 0 0 0 0 0 0 \n", - "901 0 1 0 0 0 0 0 0 0 \n", - "902 1 1 0 0 0 0 0 0 0 \n", - "903 0 1 0 0 0 0 0 0 0 \n", - "904 1 0 0 0 0 1 0 0 0 \n", - "905 1 0 0 0 0 1 0 0 0 \n", - "906 1 0 0 0 0 1 0 0 0 \n", - "907 0 0 0 0 0 1 0 0 0 \n", - "908 0 0 0 0 0 1 0 0 0 \n", - "909 1 0 0 0 0 1 0 0 0 \n", - "910 1 0 0 0 1 0 0 0 0 \n", - "911 1 0 0 0 0 1 0 0 0 \n", - "912 1 0 0 0 0 1 0 0 0 \n", - "913 1 0 0 0 0 1 0 0 0 \n", - "914 1 0 0 0 0 1 0 0 0 \n", - "915 1 0 0 0 0 1 0 0 0 \n", - "916 0 0 1 0 0 0 0 0 0 \n", - "917 1 0 0 0 0 0 1 0 0 \n", - "918 1 1 0 0 0 0 0 0 0 \n", - "919 1 0 0 0 0 1 0 0 0 \n", - "920 1 1 0 0 0 0 0 0 0 \n", - "... ... ... ... ... ... ... ... ... ... \n", - "1279 0 0 0 0 1 0 0 0 0 \n", - "1280 1 0 0 0 0 1 0 0 0 \n", - "1281 1 0 0 0 0 1 0 0 0 \n", - "1282 1 1 0 0 0 0 0 0 0 \n", - "1283 1 1 0 0 0 0 0 0 0 \n", - "1284 1 1 0 0 0 0 0 0 0 \n", - "1285 1 0 0 0 0 1 0 0 0 \n", - "1286 0 0 0 0 0 0 1 0 0 \n", - "1287 1 0 0 0 0 0 1 0 0 \n", - "1288 1 0 0 0 1 0 0 0 0 \n", - "1289 1 0 0 0 0 1 0 0 0 \n", - "1290 0 0 0 0 0 0 1 0 0 \n", - "1291 1 1 0 0 0 0 0 0 0 \n", - "1292 1 1 0 0 0 0 0 0 0 \n", - "1293 1 1 0 0 0 0 0 0 0 \n", - "1294 1 0 0 0 0 1 0 0 0 \n", - "1295 1 0 0 0 0 1 0 0 0 \n", - "1296 1 0 0 0 0 1 0 0 0 \n", - "1297 1 1 0 0 0 0 0 0 0 \n", - "1298 1 0 0 0 0 0 1 0 0 \n", - "1299 1 0 0 0 0 1 0 0 0 \n", - "1300 0 0 0 0 1 0 0 0 0 \n", - "1301 1 0 0 0 0 0 1 0 0 \n", - "1302 1 1 0 0 0 0 0 0 0 \n", - "1303 1 1 0 0 0 0 0 0 0 \n", - "1304 0 0 0 0 1 0 0 0 0 \n", - "1305 0 1 0 0 0 0 0 0 0 \n", - "1306 1 0 0 0 0 1 0 0 0 \n", - "1307 1 0 0 0 0 1 0 0 0 \n", - "1308 1 0 0 0 0 1 0 0 0 \n", - "\n", - " PClass2 PClass3 \n", - "891 0 1 \n", - "892 0 1 \n", - "893 0 1 \n", - "894 0 1 \n", - "895 0 1 \n", - "896 0 1 \n", - "897 0 1 \n", - "898 0 1 \n", - "899 0 1 \n", - "900 0 1 \n", - "901 0 1 \n", - "902 0 1 \n", - "903 0 1 \n", - "904 0 1 \n", - "905 0 1 \n", - "906 0 1 \n", - "907 0 1 \n", - "908 0 1 \n", - "909 0 1 \n", - "910 0 1 \n", - "911 0 1 \n", - "912 0 1 \n", - "913 0 1 \n", - "914 0 1 \n", - "915 0 1 \n", - "916 0 1 \n", - "917 0 1 \n", - "918 0 1 \n", - "919 0 1 \n", - "920 0 1 \n", - "... ... ... \n", - "1279 0 1 \n", - "1280 0 1 \n", - "1281 0 1 \n", - "1282 0 1 \n", - "1283 0 1 \n", - "1284 0 1 \n", - "1285 0 1 \n", - "1286 0 1 \n", - "1287 0 1 \n", - "1288 0 1 \n", - "1289 0 1 \n", - "1290 0 1 \n", - "1291 0 1 \n", - "1292 0 1 \n", - "1293 0 1 \n", - "1294 0 1 \n", - "1295 0 1 \n", - "1296 0 1 \n", - "1297 0 1 \n", - "1298 0 1 \n", - "1299 0 1 \n", - "1300 0 1 \n", - "1301 0 1 \n", - "1302 0 1 \n", - "1303 0 1 \n", - "1304 0 1 \n", - "1305 0 1 \n", - "1306 0 1 \n", - "1307 0 1 \n", - "1308 0 1 \n", - "\n", - "[418 rows x 11 columns]" - ] - }, - "execution_count": 124, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "holdout[selectdColumns]" - ] - }, - { - "cell_type": "code", - "execution_count": 125, - "metadata": {}, - "outputs": [], - "source": [ - "rf = RandomForestClassifier (n_estimators=100)\n", - "rf.fit(all_X,all_y)\n", - "predictions = rf.predict(holdout[selectdColumns])\n" - ] - }, - { - "cell_type": "code", - "execution_count": 126, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0\n", - " 0 0 0 0 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", - " 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0\n", - " 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0\n", - " 0 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0\n", - " 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 0 1 1 0 1 0 0 0 0 0 0 0 1 1\n", - " 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0\n", - " 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0\n", - " 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1\n", - " 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1\n", - " 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", - " 0 0 1 0 0 0 1 0 0 0 0]\n" - ] - } - ], - "source": [ - "print(predictions)" - ] - }, - { - "cell_type": "code", - "execution_count": 127, - "metadata": {}, - "outputs": [], - "source": [ - "#Now we have predictions. And from the CSV File we have the actual outputs.\n", - "#Let's assign the actual outputs from the CSV into cheatvalues" - ] - }, - { - "cell_type": "code", - "execution_count": 128, - "metadata": {}, - "outputs": [], - "source": [ - "cheatvalues = [0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "1,\n", - "0,\n", - "1,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "1,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0,\n", - "0]" - ] - }, - { - "cell_type": "code", - "execution_count": 129, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "418" - ] - }, - "execution_count": 129, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "len(predictions)" - ] - }, - { - "cell_type": "code", - "execution_count": 130, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "418" - ] - }, - "execution_count": 130, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "len(cheatvalues)" - ] - }, - { - "cell_type": "code", - "execution_count": 131, - "metadata": {}, - "outputs": [], - "source": [ - "accuracy = accuracy_score(cheatvalues, predictions)" - ] - }, - { - "cell_type": "code", - "execution_count": 132, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.7296650717703349\n" - ] - } - ], - "source": [ - "print(accuracy)" - ] - }, - { - "cell_type": "code", - "execution_count": 133, - "metadata": {}, - "outputs": [], - "source": [ - "#THE END " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.5" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 7de8c95ed186e8a99880df473848de958789f2a3 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Tue, 9 Oct 2018 15:20:34 +0530 Subject: [PATCH 12/39] Delete iris.csv --- iris.csv | 149 ------------------------------------------------------- 1 file changed, 149 deletions(-) delete mode 100644 iris.csv diff --git a/iris.csv b/iris.csv deleted file mode 100644 index 973902e..0000000 --- a/iris.csv +++ /dev/null @@ -1,149 +0,0 @@ -sepallength,sepalwidth,petallength,petalwidth,class -4.7,3.2,1.3,0.2,1 -4.6,3.1,1.5,0.2,1 -5.0,3.6,1.4,0.2,1 -5.4,3.9,1.7,0.4,1 -4.6,3.4,1.4,0.3,1 -5.0,3.4,1.5,0.2,1 -4.4,2.9,1.4,0.2,1 -4.9,3.1,1.5,0.1,1 -5.4,3.7,1.5,0.2,1 -4.8,3.4,1.6,0.2,1 -4.8,3.0,1.4,0.1,1 -4.3,3.0,1.1,0.1,1 -5.8,4.0,1.2,0.2,1 -5.7,4.4,1.5,0.4,1 -5.4,3.9,1.3,0.4,1 -5.1,3.5,1.4,0.3,1 -5.7,3.8,1.7,0.3,1 -5.1,3.8,1.5,0.3,1 -5.4,3.4,1.7,0.2,1 -5.1,3.7,1.5,0.4,1 -4.6,3.6,1.0,0.2,1 -5.1,3.3,1.7,0.5,1 -4.8,3.4,1.9,0.2,1 -5.0,3.0,1.6,0.2,1 -5.0,3.4,1.6,0.4,1 -5.2,3.5,1.5,0.2,1 -5.2,3.4,1.4,0.2,1 -4.7,3.2,1.6,0.2,1 -4.8,3.1,1.6,0.2,1 -5.4,3.4,1.5,0.4,1 -5.2,4.1,1.5,0.1,1 -5.5,4.2,1.4,0.2,1 -4.9,3.1,1.5,0.1,1 -5.0,3.2,1.2,0.2,1 -5.5,3.5,1.3,0.2,1 -4.9,3.1,1.5,0.1,1 -4.4,3.0,1.3,0.2,1 -5.1,3.4,1.5,0.2,1 -5.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 -6.2,3.4,5.4,2.3,3 -5.9,3.0,5.1,1.8,3 \ No newline at end of file From 44e37b210c56c0d157880e9eb051ffd9c774d351 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Tue, 9 Oct 2018 15:20:46 +0530 Subject: [PATCH 13/39] Add files via upload --- Data/iris.csv | 149 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 Data/iris.csv diff --git a/Data/iris.csv b/Data/iris.csv new file mode 100644 index 0000000..973902e --- /dev/null +++ b/Data/iris.csv @@ -0,0 +1,149 @@ +sepallength,sepalwidth,petallength,petalwidth,class +4.7,3.2,1.3,0.2,1 +4.6,3.1,1.5,0.2,1 +5.0,3.6,1.4,0.2,1 +5.4,3.9,1.7,0.4,1 +4.6,3.4,1.4,0.3,1 +5.0,3.4,1.5,0.2,1 +4.4,2.9,1.4,0.2,1 +4.9,3.1,1.5,0.1,1 +5.4,3.7,1.5,0.2,1 +4.8,3.4,1.6,0.2,1 +4.8,3.0,1.4,0.1,1 +4.3,3.0,1.1,0.1,1 +5.8,4.0,1.2,0.2,1 +5.7,4.4,1.5,0.4,1 +5.4,3.9,1.3,0.4,1 +5.1,3.5,1.4,0.3,1 +5.7,3.8,1.7,0.3,1 +5.1,3.8,1.5,0.3,1 +5.4,3.4,1.7,0.2,1 +5.1,3.7,1.5,0.4,1 +4.6,3.6,1.0,0.2,1 +5.1,3.3,1.7,0.5,1 +4.8,3.4,1.9,0.2,1 +5.0,3.0,1.6,0.2,1 +5.0,3.4,1.6,0.4,1 +5.2,3.5,1.5,0.2,1 +5.2,3.4,1.4,0.2,1 +4.7,3.2,1.6,0.2,1 +4.8,3.1,1.6,0.2,1 +5.4,3.4,1.5,0.4,1 +5.2,4.1,1.5,0.1,1 +5.5,4.2,1.4,0.2,1 +4.9,3.1,1.5,0.1,1 +5.0,3.2,1.2,0.2,1 +5.5,3.5,1.3,0.2,1 +4.9,3.1,1.5,0.1,1 +4.4,3.0,1.3,0.2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,1.9,3 +6.5,3.0,5.2,2.0,3 +6.2,3.4,5.4,2.3,3 +5.9,3.0,5.1,1.8,3 \ No newline at end of file From 965d520c89f065d8338cb5e3ff690fac495d8a98 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Tue, 9 Oct 2018 15:34:16 +0530 Subject: [PATCH 14/39] Add files via upload --- IRIS.ipynb | 225 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 135 insertions(+), 90 deletions(-) diff --git a/IRIS.ipynb b/IRIS.ipynb index e3fa828..a433e14 100644 --- a/IRIS.ipynb +++ b/IRIS.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 24, + "execution_count": 36, "metadata": {}, "outputs": [], "source": [ @@ -21,7 +21,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 37, "metadata": {}, "outputs": [], "source": [ @@ -30,16 +30,112 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 38, "metadata": {}, "outputs": [], "source": [ - "irisCompleteData= pd.read_csv(\"C:/MyFolder/iris.csv\")" + "irisCompleteData= pd.read_csv(\"C:/Users/rvaish/Documents/Python Scripts/MachineLearningPython-IRIS/MachineLearningPython-IRIS/Data/iris.csv\")" ] }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
sepallengthsepalwidthpetallengthpetalwidthclass
04.73.21.30.21
14.63.11.50.21
25.03.61.40.21
35.43.91.70.41
44.63.41.40.31
\n", + "
" + ], + "text/plain": [ + " sepallength sepalwidth petallength petalwidth class\n", + "0 4.7 3.2 1.3 0.2 1\n", + "1 4.6 3.1 1.5 0.2 1\n", + "2 5.0 3.6 1.4 0.2 1\n", + "3 5.4 3.9 1.7 0.4 1\n", + "4 4.6 3.4 1.4 0.3 1" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "irisCompleteData.head(5)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, "metadata": {}, "outputs": [], "source": [ @@ -48,7 +144,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 41, "metadata": {}, "outputs": [], "source": [ @@ -57,7 +153,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 42, "metadata": {}, "outputs": [ { @@ -74,7 +170,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 43, "metadata": {}, "outputs": [], "source": [ @@ -83,7 +179,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 44, "metadata": {}, "outputs": [], "source": [ @@ -92,41 +188,24 @@ }, { "cell_type": "code", - "execution_count": 33, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "140\n" - ] - } - ], - "source": [ - "print(len(trainData))" - ] - }, - { - "cell_type": "code", - "execution_count": 34, + "execution_count": 45, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "8\n" + "Dimensions of train: (8, 5)\n" ] } ], "source": [ - "print(len(untouchedTestData))" + "print(\"Dimensions of train: {}\".format(untouchedTestData.shape))" ] }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 46, "metadata": {}, "outputs": [], "source": [ @@ -139,7 +218,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 47, "metadata": {}, "outputs": [], "source": [ @@ -148,7 +227,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 48, "metadata": {}, "outputs": [ { @@ -165,12 +244,12 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 49, "metadata": {}, "outputs": [], "source": [ - "# Right now our Training Dataframe is of (120, 5) dimention.\n", - "# and our Testing Dataframe is of (28, 4) dimention.\n", + "# Right now our Training Dataframe is of (140, 5) dimention.\n", + "# and our Testing Dataframe is of (8, 4) dimention.\n", "\n", "#Now, we are going introduce 3 new columns (in both Training and Testing Dataframes)\n", "#3 new columns will be for class.Default values = 0 [SPARSE MATRIX WAY !!!]" @@ -178,7 +257,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 50, "metadata": {}, "outputs": [ { @@ -201,19 +280,19 @@ } ], "source": [ - "new_age_columns = [\"Iris-setosa\",\"Iris-versicolor\",\"Iris-virginica\"]\n", + "new_columns = [\"Iris-setosa\",\"Iris-versicolor\",\"Iris-virginica\"]\n", "\n", - "for newCol in new_age_columns:\n", + "for newCol in new_columns:\n", " trainData[newCol] =0\n", " \n", - "for newCol in new_age_columns:\n", + "for newCol in new_columns:\n", " untouchedTestData[newCol] =0\n", " \n" ] }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 51, "metadata": {}, "outputs": [ { @@ -230,7 +309,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 52, "metadata": {}, "outputs": [ { @@ -247,7 +326,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 53, "metadata": {}, "outputs": [], "source": [ @@ -257,7 +336,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 54, "metadata": {}, "outputs": [ { @@ -293,7 +372,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 55, "metadata": {}, "outputs": [], "source": [ @@ -302,7 +381,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 56, "metadata": {}, "outputs": [], "source": [ @@ -311,7 +390,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 57, "metadata": {}, "outputs": [], "source": [ @@ -320,7 +399,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 58, "metadata": {}, "outputs": [], "source": [ @@ -329,7 +408,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 59, "metadata": {}, "outputs": [ { @@ -338,7 +417,7 @@ "GaussianNB(priors=None)" ] }, - "execution_count": 48, + "execution_count": 59, "metadata": {}, "output_type": "execute_result" } @@ -349,49 +428,15 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 63, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "140\n" - ] - } - ], - "source": [ - "print(len(trainData))" - ] - }, - { - "cell_type": "code", - "execution_count": 50, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "8\n" - ] - } - ], - "source": [ - "print(len(untouchedTestData))" - ] - }, - { - "cell_type": "code", - "execution_count": 54, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[1 1 3 3 3 1 2 2 2 3 1 3 1 3 1 1 1 2 2 3 2 2 2 1 1 1 1 1 1 2 3 2 1 1 3]\n", - "35\n" + "[1 2 1 2 2 1 3 3 3 1 3 1 2 2 3 2 3 3 1 2 2 1 3 1 1 2 1 2]\n", + "28\n" ] } ], @@ -413,7 +458,7 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 64, "metadata": {}, "outputs": [ { @@ -437,7 +482,7 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 65, "metadata": {}, "outputs": [], "source": [ @@ -446,7 +491,7 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 66, "metadata": {}, "outputs": [], "source": [ @@ -455,7 +500,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 67, "metadata": {}, "outputs": [ { From a320b8269e707d70cfa65a987bb41d04ddc9b9c8 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Tue, 9 Oct 2018 15:41:07 +0530 Subject: [PATCH 15/39] Add files via upload --- IRIS.ipynb | 134 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 115 insertions(+), 19 deletions(-) diff --git a/IRIS.ipynb b/IRIS.ipynb index a433e14..9b33de1 100644 --- a/IRIS.ipynb +++ b/IRIS.ipynb @@ -370,6 +370,114 @@ "trainData['Iris-virginica'] = np.where(trainData['class']==3, '1', '0')" ] }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
sepallengthsepalwidthpetallengthpetalwidthclassIris-setosaIris-versicolorIris-virginica
04.73.21.30.21100
14.63.11.50.21100
25.03.61.40.21100
35.43.91.70.41100
\n", + "
" + ], + "text/plain": [ + " sepallength sepalwidth petallength petalwidth class Iris-setosa \\\n", + "0 4.7 3.2 1.3 0.2 1 1 \n", + "1 4.6 3.1 1.5 0.2 1 1 \n", + "2 5.0 3.6 1.4 0.2 1 1 \n", + "3 5.4 3.9 1.7 0.4 1 1 \n", + "\n", + " Iris-versicolor Iris-virginica \n", + "0 0 0 \n", + "1 0 0 \n", + "2 0 0 \n", + "3 0 0 " + ] + }, + "execution_count": 68, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "trainData.head(4)" + ] + }, { "cell_type": "code", "execution_count": 55, @@ -428,7 +536,7 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 71, "metadata": {}, "outputs": [ { @@ -436,7 +544,7 @@ "output_type": "stream", "text": [ "[1 2 1 2 2 1 3 3 3 1 3 1 2 2 3 2 3 3 1 2 2 1 3 1 1 2 1 2]\n", - "28\n" + "1.0\n" ] } ], @@ -450,10 +558,8 @@ "lr.fit(train_X, train_y)\n", "predictions = lr.predict(test_X)\n", "print(predictions)\n", - "print(len(predictions))\n", - "\n", - "\n", - "\n" + "accuracy = accuracy_score(test_y, predictions)\n", + "print(accuracy)" ] }, { @@ -471,7 +577,6 @@ } ], "source": [ - "\n", "scores = cross_val_score(lr, all_X, all_y, cv=10)\n", "scores.sort()\n", "accuracy = scores.mean()\n", @@ -482,25 +587,16 @@ }, { "cell_type": "code", - "execution_count": 65, - "metadata": {}, - "outputs": [], - "source": [ - "holdout = untouchedTestData " - ] - }, - { - "cell_type": "code", - "execution_count": 66, + "execution_count": 72, "metadata": {}, "outputs": [], "source": [ - "predictions = lr.predict(holdout[selectdColumns])" + "predictions = lr.predict(untouchedTestData[selectdColumns])" ] }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 73, "metadata": {}, "outputs": [ { From c1b0d55c4e6c63701e66d557e3f54874b40dd55f Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Tue, 9 Oct 2018 23:39:37 +0530 Subject: [PATCH 16/39] Add files via upload --- IRIS - KNN.ipynb | 241 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) create mode 100644 IRIS - KNN.ipynb diff --git a/IRIS - KNN.ipynb b/IRIS - KNN.ipynb new file mode 100644 index 0000000..c453a51 --- /dev/null +++ b/IRIS - KNN.ipynb @@ -0,0 +1,241 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\Lenovo\\Anaconda3\\lib\\site-packages\\sklearn\\cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.\n", + " \"This module will be removed in 0.20.\", DeprecationWarning)\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "from sklearn.ensemble import RandomForestClassifier\n", + "from sklearn.cross_validation import train_test_split\n", + "from sklearn.externals import joblib\n", + "from sklearn.naive_bayes import GaussianNB\n", + "from sklearn.linear_model import LogisticRegression\n", + "import numpy as np\n", + "from sklearn.metrics import accuracy_score\n", + "from sklearn.model_selection import cross_val_score\n", + "from sklearn import metrics\n", + "from sklearn.neighbors import KNeighborsClassifier" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "#Loading the complete File" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "irisCompleteData= pd.read_csv(\"C:/Users/Lenovo/Desktop/IPY/iris.csv\")" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "#In the file we have total 148 records. From these records we have decided to keep 140 for training purpose." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "trainData = irisCompleteData.head(140)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimensions of train: (140, 5)\n" + ] + } + ], + "source": [ + "print(\"Dimensions of train: {}\".format(trainData.shape))\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "#The reamining 8 records will be used for testing purpose." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "untouchedTestData = irisCompleteData.tail(8)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "140\n" + ] + } + ], + "source": [ + "print(len(trainData))" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "8\n" + ] + } + ], + "source": [ + "print(len(untouchedTestData))" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "#From the test records, we are deleting the 'class' columns.\n", + "#ONE THING IMPORTANT IS THAT WE ARE NOT DELETING FROM THE ACTUAL FILE BUT FROM THE DATAFRAME.\n", + "#ANOTHER IMPORTANT THING IS THAT- HERE WE HAVE ONE FILE WHICH WE HAVE DIVIDED INTO TWO DATAFRAMES.\n", + "#IF WE WERE GIVEN TWO FILES (TEST & TRAIN) WE COULD HAVE SIMPLY LOADED BOTH OF THEM INTO TWO DIFFERENT DATAFRAMES.\n", + "#ONE FILE | TWO FILE APPROACH MAKES NO DIFFERENCE ! " + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [], + "source": [ + "del untouchedTestData['class']" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimensions of test: (8, 4)\n" + ] + } + ], + "source": [ + "print(\"Dimensions of test: {}\".format(untouchedTestData.shape))" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[3 3 3 3 3 3 3 3]\n" + ] + } + ], + "source": [ + "neigh = KNeighborsClassifier(n_neighbors=3)\n", + "neigh.fit(trainData.iloc[:,0:4], trainData['class'])\n", + "\n", + "# Predicted class\n", + "print(neigh.predict(untouchedTestData))\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.4" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 5c8e9a8d57efad534483fb9fbe6b5fe93c277c98 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 30 Nov 2018 17:34:43 +0530 Subject: [PATCH 17/39] Create README.MD --- README.MD | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 README.MD diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..d9a66c9 --- /dev/null +++ b/README.MD @@ -0,0 +1,3 @@ +##### Tutorial Documentation: +##### [Cross Validation Pictorial Representation](https://github.com/rahulvaish/ReferenceDocuments/blob/master/QuickGuide%5BIMAGES%5D/MachineLearningQuickGuide%5BIMAGES%5D/CrossValidation%5BPictorialRepresentation%5D.jpg) +##### [Train-Test Split Pictorial Represntation](https://github.com/rahulvaish/ReferenceDocuments/blob/master/QuickGuide%5BIMAGES%5D/MachineLearningQuickGuide%5BIMAGES%5D/Train-Test-Split%5BPictoriaclRepresentation%5D.png) From 7279b97b6ca500a19d3ec17963065c17e9e6908e Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 30 Nov 2018 17:47:37 +0530 Subject: [PATCH 18/39] Update README.MD --- README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.MD b/README.MD index d9a66c9..3061578 100644 --- a/README.MD +++ b/README.MD @@ -1,3 +1,3 @@ ##### Tutorial Documentation: ##### [Cross Validation Pictorial Representation](https://github.com/rahulvaish/ReferenceDocuments/blob/master/QuickGuide%5BIMAGES%5D/MachineLearningQuickGuide%5BIMAGES%5D/CrossValidation%5BPictorialRepresentation%5D.jpg) -##### [Train-Test Split Pictorial Represntation](https://github.com/rahulvaish/ReferenceDocuments/blob/master/QuickGuide%5BIMAGES%5D/MachineLearningQuickGuide%5BIMAGES%5D/Train-Test-Split%5BPictoriaclRepresentation%5D.png) +##### [Train-Test Split Pictorial Represntation](https://github.com/rahulvaish/ReferenceDocuments/blob/master/QuickGuide%5BIMAGES%5D/MachineLearningQuickGuide%5BIMAGES%5D/Train-Test-Split%5BPictorialRepresentation%5D.png) From f34c7fbbe1dc054f3539a42ccb76ad982980af30 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 30 Nov 2018 18:42:19 +0530 Subject: [PATCH 19/39] Update README.MD --- README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.MD b/README.MD index 3061578..296dcef 100644 --- a/README.MD +++ b/README.MD @@ -1,3 +1,3 @@ -##### Tutorial Documentation: +##### Reference Documents: ##### [Cross Validation Pictorial Representation](https://github.com/rahulvaish/ReferenceDocuments/blob/master/QuickGuide%5BIMAGES%5D/MachineLearningQuickGuide%5BIMAGES%5D/CrossValidation%5BPictorialRepresentation%5D.jpg) ##### [Train-Test Split Pictorial Represntation](https://github.com/rahulvaish/ReferenceDocuments/blob/master/QuickGuide%5BIMAGES%5D/MachineLearningQuickGuide%5BIMAGES%5D/Train-Test-Split%5BPictorialRepresentation%5D.png) From 1325d2ab69fc3465270ecf88de0da88e0fb9de43 Mon Sep 17 00:00:00 2001 From: Rahul Date: Sun, 2 Dec 2018 21:30:25 +0530 Subject: [PATCH 20/39] IRIS --- IRIS - KNN.ipynb => IRIS-KNN.ipynb | 0 SplitPictoriaclRepresentation.png | Bin 22970 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) rename IRIS - KNN.ipynb => IRIS-KNN.ipynb (100%) delete mode 100644 SplitPictoriaclRepresentation.png diff --git a/IRIS - KNN.ipynb b/IRIS-KNN.ipynb similarity index 100% rename from IRIS - KNN.ipynb rename to IRIS-KNN.ipynb diff --git a/SplitPictoriaclRepresentation.png b/SplitPictoriaclRepresentation.png deleted file mode 100644 index c3c997c39e23a764988818997ede265dbb12ea8a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22970 zcm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m&S!wqH}PjkWW z^fT>i^`dB>EJo9)Dspg^$;`y;jgi=Iq0-K+iKWl^x{x!$daj~s>@sCab^R-g<)*un zdS#o}a Date: Tue, 25 Dec 2018 16:57:14 +0530 Subject: [PATCH 21/39] Delete README.MD --- README.MD | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 README.MD diff --git a/README.MD b/README.MD deleted file mode 100644 index 296dcef..0000000 --- a/README.MD +++ /dev/null @@ -1,3 +0,0 @@ -##### Reference Documents: -##### [Cross Validation Pictorial Representation](https://github.com/rahulvaish/ReferenceDocuments/blob/master/QuickGuide%5BIMAGES%5D/MachineLearningQuickGuide%5BIMAGES%5D/CrossValidation%5BPictorialRepresentation%5D.jpg) -##### [Train-Test Split Pictorial Represntation](https://github.com/rahulvaish/ReferenceDocuments/blob/master/QuickGuide%5BIMAGES%5D/MachineLearningQuickGuide%5BIMAGES%5D/Train-Test-Split%5BPictorialRepresentation%5D.png) From 0d4a464551cec28d25b0911eeaf894f71a369ad6 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 28 Dec 2018 17:06:51 +0530 Subject: [PATCH 22/39] Add files via upload --- IRIS.ipynb | 341 +++++------------------------------------------------ 1 file changed, 32 insertions(+), 309 deletions(-) diff --git a/IRIS.ipynb b/IRIS.ipynb index 9b33de1..00062a7 100644 --- a/IRIS.ipynb +++ b/IRIS.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 36, + "execution_count": 58, "metadata": {}, "outputs": [], "source": [ @@ -21,7 +21,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 59, "metadata": {}, "outputs": [], "source": [ @@ -30,16 +30,16 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 60, "metadata": {}, "outputs": [], "source": [ - "irisCompleteData= pd.read_csv(\"C:/Users/rvaish/Documents/Python Scripts/MachineLearningPython-IRIS/MachineLearningPython-IRIS/Data/iris.csv\")" + "irisCompleteData= pd.read_csv(\"C://Users//Lenovo//Documents//Desktop//IPY//iris.csv\")" ] }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 61, "metadata": {}, "outputs": [ { @@ -124,7 +124,7 @@ "4 4.6 3.4 1.4 0.3 1" ] }, - "execution_count": 39, + "execution_count": 61, "metadata": {}, "output_type": "execute_result" } @@ -135,7 +135,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 62, "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 63, "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 64, "metadata": {}, "outputs": [ { @@ -170,7 +170,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 65, "metadata": {}, "outputs": [], "source": [ @@ -179,7 +179,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 66, "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 67, "metadata": {}, "outputs": [ { @@ -205,7 +205,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 68, "metadata": {}, "outputs": [], "source": [ @@ -218,7 +218,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 69, "metadata": {}, "outputs": [], "source": [ @@ -227,7 +227,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 70, "metadata": {}, "outputs": [ { @@ -244,270 +244,25 @@ }, { "cell_type": "code", - "execution_count": 49, - "metadata": {}, - "outputs": [], - "source": [ - "# Right now our Training Dataframe is of (140, 5) dimention.\n", - "# and our Testing Dataframe is of (8, 4) dimention.\n", - "\n", - "#Now, we are going introduce 3 new columns (in both Training and Testing Dataframes)\n", - "#3 new columns will be for class.Default values = 0 [SPARSE MATRIX WAY !!!]" - ] - }, - { - "cell_type": "code", - "execution_count": 50, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:4: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " after removing the cwd from sys.path.\n", - "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:7: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " import sys\n" - ] - } - ], - "source": [ - "new_columns = [\"Iris-setosa\",\"Iris-versicolor\",\"Iris-virginica\"]\n", - "\n", - "for newCol in new_columns:\n", - " trainData[newCol] =0\n", - " \n", - "for newCol in new_columns:\n", - " untouchedTestData[newCol] =0\n", - " \n" - ] - }, - { - "cell_type": "code", - "execution_count": 51, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Dimensions of train: (140, 8)\n" - ] - } - ], - "source": [ - "print(\"Dimensions of train: {}\".format(trainData.shape))" - ] - }, - { - "cell_type": "code", - "execution_count": 52, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Dimensions of train: (8, 7)\n" - ] - } - ], - "source": [ - "print(\"Dimensions of train: {}\".format(untouchedTestData.shape))" - ] - }, - { - "cell_type": "code", - "execution_count": 53, - "metadata": {}, - "outputs": [], - "source": [ - "#Now as for 3 newly created columns we have assigned 0 as default values ; but that's not going to take things forward.\n", - "#We need to assign respective values into the same.\n" - ] - }, - { - "cell_type": "code", - "execution_count": 54, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " \"\"\"Entry point for launching an IPython kernel.\n", - "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:2: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " \n", - "C:\\Users\\rvaish\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\ipykernel_launcher.py:3: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " This is separate from the ipykernel package so we can avoid doing imports until\n" - ] - } - ], - "source": [ - "trainData['Iris-setosa'] = np.where(trainData['class']==1, '1', '0')\n", - "trainData['Iris-versicolor'] = np.where(trainData['class']==2, '1', '0')\n", - "trainData['Iris-virginica'] = np.where(trainData['class']==3, '1', '0')" - ] - }, - { - "cell_type": "code", - "execution_count": 68, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
sepallengthsepalwidthpetallengthpetalwidthclassIris-setosaIris-versicolorIris-virginica
04.73.21.30.21100
14.63.11.50.21100
25.03.61.40.21100
35.43.91.70.41100
\n", - "
" - ], - "text/plain": [ - " sepallength sepalwidth petallength petalwidth class Iris-setosa \\\n", - "0 4.7 3.2 1.3 0.2 1 1 \n", - "1 4.6 3.1 1.5 0.2 1 1 \n", - "2 5.0 3.6 1.4 0.2 1 1 \n", - "3 5.4 3.9 1.7 0.4 1 1 \n", - "\n", - " Iris-versicolor Iris-virginica \n", - "0 0 0 \n", - "1 0 0 \n", - "2 0 0 \n", - "3 0 0 " - ] - }, - "execution_count": 68, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "trainData.head(4)" - ] - }, - { - "cell_type": "code", - "execution_count": 55, - "metadata": {}, - "outputs": [], - "source": [ - "#Now choose the important variables (columns)" - ] - }, - { - "cell_type": "code", - "execution_count": 56, + "execution_count": 71, "metadata": {}, "outputs": [], "source": [ - "selectdColumns = [\"sepallength\",\"sepalwidth\",\"petallength\",\"petalwidth\",\"Iris-setosa\",\"Iris-versicolor\",\"Iris-virginica\"]" + "selectdColumns = [\"sepallength\",\"sepalwidth\",\"petallength\",\"petalwidth\"]" ] }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 72, "metadata": {}, "outputs": [], "source": [ - "# Now we have Sparse Matrix is prepared, time to apply ML modeling." + "# Now, time to apply ML modeling." ] }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 73, "metadata": {}, "outputs": [], "source": [ @@ -516,35 +271,15 @@ }, { "cell_type": "code", - "execution_count": 59, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "GaussianNB(priors=None)" - ] - }, - "execution_count": 59, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "lr.fit(trainData[selectdColumns], trainData[\"class\"])" - ] - }, - { - "cell_type": "code", - "execution_count": 71, + "execution_count": 74, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[1 2 1 2 2 1 3 3 3 1 3 1 2 2 3 2 3 3 1 2 2 1 3 1 1 2 1 2]\n", - "1.0\n" + "[1 2 1 2 2 1 2 3 3 1 3 1 2 2 3 2 2 3 1 2 2 1 3 1 1 2 1 2]\n", + "0.9285714285714286\n" ] } ], @@ -553,7 +288,8 @@ "all_y = trainData['class']\n", "\n", "train_X, test_X, train_y, test_y = train_test_split(\n", - " all_X, all_y, test_size=0.20,random_state=0)\n", + " all_X, all_y, random_state=0, test_size=0.20)\n", + "\n", "\n", "lr.fit(train_X, train_y)\n", "predictions = lr.predict(test_X)\n", @@ -564,15 +300,16 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 75, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]\n", - "1.0\n" + "[0.85714286 0.92307692 0.92857143 0.92857143 0.93333333 0.93333333\n", + " 1. 1. 1. 1. ]\n", + "0.9504029304029304\n" ] } ], @@ -587,7 +324,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 76, "metadata": {}, "outputs": [], "source": [ @@ -596,7 +333,7 @@ }, { "cell_type": "code", - "execution_count": 73, + "execution_count": 77, "metadata": {}, "outputs": [ { @@ -611,20 +348,6 @@ "print(predictions)" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "code", "execution_count": null, @@ -649,7 +372,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.5" + "version": "3.6.4" } }, "nbformat": 4, From f7bd0a6cbb3416f5412cc32a1639a967bc5ce875 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 28 Dec 2018 17:07:20 +0530 Subject: [PATCH 23/39] Delete IRIS-KNN.ipynb --- IRIS-KNN.ipynb | 241 ------------------------------------------------- 1 file changed, 241 deletions(-) delete mode 100644 IRIS-KNN.ipynb diff --git a/IRIS-KNN.ipynb b/IRIS-KNN.ipynb deleted file mode 100644 index c453a51..0000000 --- a/IRIS-KNN.ipynb +++ /dev/null @@ -1,241 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\Lenovo\\Anaconda3\\lib\\site-packages\\sklearn\\cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.\n", - " \"This module will be removed in 0.20.\", DeprecationWarning)\n" - ] - } - ], - "source": [ - "import numpy as np\n", - "import pandas as pd\n", - "from sklearn.ensemble import RandomForestClassifier\n", - "from sklearn.cross_validation import train_test_split\n", - "from sklearn.externals import joblib\n", - "from sklearn.naive_bayes import GaussianNB\n", - "from sklearn.linear_model import LogisticRegression\n", - "import numpy as np\n", - "from sklearn.metrics import accuracy_score\n", - "from sklearn.model_selection import cross_val_score\n", - "from sklearn import metrics\n", - "from sklearn.neighbors import KNeighborsClassifier" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "#Loading the complete File" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [], - "source": [ - "irisCompleteData= pd.read_csv(\"C:/Users/Lenovo/Desktop/IPY/iris.csv\")" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [], - "source": [ - "#In the file we have total 148 records. From these records we have decided to keep 140 for training purpose." - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [], - "source": [ - "trainData = irisCompleteData.head(140)" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Dimensions of train: (140, 5)\n" - ] - } - ], - "source": [ - "print(\"Dimensions of train: {}\".format(trainData.shape))\n" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [], - "source": [ - "#The reamining 8 records will be used for testing purpose." - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [], - "source": [ - "untouchedTestData = irisCompleteData.tail(8)" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "140\n" - ] - } - ], - "source": [ - "print(len(trainData))" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "8\n" - ] - } - ], - "source": [ - "print(len(untouchedTestData))" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": {}, - "outputs": [], - "source": [ - "#From the test records, we are deleting the 'class' columns.\n", - "#ONE THING IMPORTANT IS THAT WE ARE NOT DELETING FROM THE ACTUAL FILE BUT FROM THE DATAFRAME.\n", - "#ANOTHER IMPORTANT THING IS THAT- HERE WE HAVE ONE FILE WHICH WE HAVE DIVIDED INTO TWO DATAFRAMES.\n", - "#IF WE WERE GIVEN TWO FILES (TEST & TRAIN) WE COULD HAVE SIMPLY LOADED BOTH OF THEM INTO TWO DIFFERENT DATAFRAMES.\n", - "#ONE FILE | TWO FILE APPROACH MAKES NO DIFFERENCE ! " - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": {}, - "outputs": [], - "source": [ - "del untouchedTestData['class']" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Dimensions of test: (8, 4)\n" - ] - } - ], - "source": [ - "print(\"Dimensions of test: {}\".format(untouchedTestData.shape))" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[3 3 3 3 3 3 3 3]\n" - ] - } - ], - "source": [ - "neigh = KNeighborsClassifier(n_neighbors=3)\n", - "neigh.fit(trainData.iloc[:,0:4], trainData['class'])\n", - "\n", - "# Predicted class\n", - "print(neigh.predict(untouchedTestData))\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.4" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From ceb44582d92ac1fb0f290b1fae0a9565533d374b Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 28 Dec 2018 17:35:10 +0530 Subject: [PATCH 24/39] Create README.MD --- README.MD | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.MD diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..4e0e1cc --- /dev/null +++ b/README.MD @@ -0,0 +1 @@ +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/rahulvaish/MachineLearning-Python/IRIS?filepath=IRIS.ipynb) From 143e501081a44cf071a498288c3847a467fd3f02 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 28 Dec 2018 17:37:53 +0530 Subject: [PATCH 25/39] Delete README.MD --- README.MD | 1 - 1 file changed, 1 deletion(-) delete mode 100644 README.MD diff --git a/README.MD b/README.MD deleted file mode 100644 index 4e0e1cc..0000000 --- a/README.MD +++ /dev/null @@ -1 +0,0 @@ -[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/rahulvaish/MachineLearning-Python/IRIS?filepath=IRIS.ipynb) From ba41470da61647126f2b4b77a958bea61a7e8c93 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 28 Dec 2018 18:06:21 +0530 Subject: [PATCH 26/39] Add files via upload --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..b59fa0c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +numpy==1.15.4 +pandas==0.22.0 \ No newline at end of file From 1419f5f3cc3738b91db6dd5e4df31af4447e48ef Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 28 Dec 2018 18:54:26 +0530 Subject: [PATCH 27/39] Update requirements.txt --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b59fa0c..4e55be9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ numpy==1.15.4 -pandas==0.22.0 \ No newline at end of file +pandas==0.22.0 +scikit-learn==0.17.1 From cc1fafccb810ed553f0fb9c7e47555ba0170d3d5 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 28 Dec 2018 19:31:36 +0530 Subject: [PATCH 28/39] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4e55be9..924da4f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ numpy==1.15.4 pandas==0.22.0 -scikit-learn==0.17.1 +scikit-learn>=0.18 From b9da15ab966a4bb80e9c19fb61213c1071013767 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 28 Dec 2018 19:35:25 +0530 Subject: [PATCH 29/39] Update requirements.txt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 924da4f..9b400a6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ numpy==1.15.4 pandas==0.22.0 scikit-learn>=0.18 +scipy>=0.15.1 From 5bdffc3a8e7318db3f88a0a6f432107ad12645fc Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 28 Dec 2018 19:42:26 +0530 Subject: [PATCH 30/39] Add files via upload --- requirements.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 9b400a6..27a0f34 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,6 @@ -numpy==1.15.4 -pandas==0.22.0 -scikit-learn>=0.18 +Pillow>=2.9.0 +numpy>=1.9.2 scipy>=0.15.1 +scikit-learn>=0.18 +matplotlib>=1.4.3 +pandas>=0.19 \ No newline at end of file From eebc43c2e18e4f0e63724027d598b060b50c748e Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Fri, 28 Dec 2018 20:42:47 +0530 Subject: [PATCH 31/39] Create environment.yml --- environment.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 environment.yml diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..a4e2fdb --- /dev/null +++ b/environment.yml @@ -0,0 +1,7 @@ +name: IRIS +channels: + - conda-forge +dependencies: + - python=3.5 + - pip: + - -r requirements.txt From eba5f87313a21c8533838aac8538d24df2f78509 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Sat, 29 Dec 2018 08:39:02 +0530 Subject: [PATCH 32/39] Add files via upload --- IRIS.ipynb | 65 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/IRIS.ipynb b/IRIS.ipynb index 00062a7..e80818a 100644 --- a/IRIS.ipynb +++ b/IRIS.ipynb @@ -2,9 +2,21 @@ "cells": [ { "cell_type": "code", - "execution_count": 58, + "execution_count": 21, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "ImportError", + "evalue": "cannot import name 'model_selection'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mnumpy\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 9\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0msklearn\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmetrics\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0maccuracy_score\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 10\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0msklearn\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmodel_selection\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mmodel_selection\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 11\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0msklearn\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mmetrics\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mImportError\u001b[0m: cannot import name 'model_selection'" + ] + } + ], "source": [ "import numpy as np\n", "import pandas as pd\n", @@ -15,13 +27,13 @@ "from sklearn.linear_model import LogisticRegression\n", "import numpy as np\n", "from sklearn.metrics import accuracy_score\n", - "from sklearn.model_selection import cross_val_score\n", + "from sklearn.model_selection import model_selection \n", "from sklearn import metrics" ] }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -30,7 +42,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -39,7 +51,7 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -124,7 +136,7 @@ "4 4.6 3.4 1.4 0.3 1" ] }, - "execution_count": 61, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -135,7 +147,7 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -144,7 +156,7 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -153,7 +165,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -170,7 +182,7 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -179,7 +191,7 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -188,7 +200,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -205,7 +217,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -218,7 +230,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -227,7 +239,7 @@ }, { "cell_type": "code", - "execution_count": 70, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -244,7 +256,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ @@ -253,7 +265,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -262,7 +274,7 @@ }, { "cell_type": "code", - "execution_count": 73, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -271,7 +283,7 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -300,7 +312,7 @@ }, { "cell_type": "code", - "execution_count": 75, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -324,7 +336,7 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -333,7 +345,7 @@ }, { "cell_type": "code", - "execution_count": 77, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -348,6 +360,13 @@ "print(predictions)" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "code", "execution_count": null, From e084ccecc572b28051bf775848693dca3ac8ea99 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Sat, 29 Dec 2018 08:47:45 +0530 Subject: [PATCH 33/39] Add files via upload --- IRIS.ipynb | 80 ++++++++++++++++++++++++++---------------------------- 1 file changed, 38 insertions(+), 42 deletions(-) diff --git a/IRIS.ipynb b/IRIS.ipynb index e80818a..8eddafd 100644 --- a/IRIS.ipynb +++ b/IRIS.ipynb @@ -2,38 +2,25 @@ "cells": [ { "cell_type": "code", - "execution_count": 21, + "execution_count": 2, "metadata": {}, - "outputs": [ - { - "ename": "ImportError", - "evalue": "cannot import name 'model_selection'", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mnumpy\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 9\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0msklearn\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmetrics\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0maccuracy_score\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 10\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0msklearn\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmodel_selection\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mmodel_selection\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 11\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0msklearn\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mmetrics\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;31mImportError\u001b[0m: cannot import name 'model_selection'" - ] - } - ], + "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "from sklearn.ensemble import RandomForestClassifier\n", - "from sklearn.cross_validation import train_test_split\n", + "from sklearn.model_selection import train_test_split\n", "from sklearn.externals import joblib\n", "from sklearn.naive_bayes import GaussianNB\n", "from sklearn.linear_model import LogisticRegression\n", "import numpy as np\n", "from sklearn.metrics import accuracy_score\n", - "from sklearn.model_selection import model_selection \n", "from sklearn import metrics" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -42,7 +29,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -51,7 +38,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -136,7 +123,7 @@ "4 4.6 3.4 1.4 0.3 1" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -147,7 +134,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -156,7 +143,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -165,7 +152,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -182,7 +169,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -191,7 +178,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -200,7 +187,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -217,7 +204,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -230,7 +217,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -239,7 +226,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -256,7 +243,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -265,7 +252,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -274,7 +261,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -283,7 +270,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -312,16 +299,18 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 19, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "[0.85714286 0.92307692 0.92857143 0.92857143 0.93333333 0.93333333\n", - " 1. 1. 1. 1. ]\n", - "0.9504029304029304\n" + "ename": "NameError", + "evalue": "name 'cross_val_score' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mscores\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcross_val_score\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlr\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mall_X\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mall_y\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcv\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[0mscores\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msort\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[0maccuracy\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mscores\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmean\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mscores\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mNameError\u001b[0m: name 'cross_val_score' is not defined" ] } ], @@ -336,7 +325,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -352,7 +341,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "[3 3 3 3 3 3 3 3]\n" + "[1 2 1 2 2 1 2 3 3 1 3 1 2 2 3 2 2 3 1 2 2 1 3 1 1 2 1 2]\n" ] } ], @@ -367,6 +356,13 @@ "outputs": [], "source": [] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "code", "execution_count": null, From ec28d949bd8bc9401f4e85f3c89e60e607f2c60e Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Sat, 29 Dec 2018 10:30:10 +0530 Subject: [PATCH 34/39] Delete requirements.txt --- requirements.txt | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 27a0f34..0000000 --- a/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -Pillow>=2.9.0 -numpy>=1.9.2 -scipy>=0.15.1 -scikit-learn>=0.18 -matplotlib>=1.4.3 -pandas>=0.19 \ No newline at end of file From 12640b811445402dbc409e3d6227a8a52192ef54 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Sat, 29 Dec 2018 10:30:21 +0530 Subject: [PATCH 35/39] Delete environment.yml --- environment.yml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 environment.yml diff --git a/environment.yml b/environment.yml deleted file mode 100644 index a4e2fdb..0000000 --- a/environment.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: IRIS -channels: - - conda-forge -dependencies: - - python=3.5 - - pip: - - -r requirements.txt From e2c682d07e9b46d79c05cf2551e1f034f4ca5c40 Mon Sep 17 00:00:00 2001 From: Rahul Vaish Date: Sat, 29 Dec 2018 10:40:43 +0530 Subject: [PATCH 36/39] Add files via upload --- IRIS.ipynb | 59 +++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/IRIS.ipynb b/IRIS.ipynb index 8eddafd..1a29464 100644 --- a/IRIS.ipynb +++ b/IRIS.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 2, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -10,6 +10,7 @@ "import pandas as pd\n", "from sklearn.ensemble import RandomForestClassifier\n", "from sklearn.model_selection import train_test_split\n", + "from sklearn.model_selection import cross_val_score\n", "from sklearn.externals import joblib\n", "from sklearn.naive_bayes import GaussianNB\n", "from sklearn.linear_model import LogisticRegression\n", @@ -20,7 +21,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -29,7 +30,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -38,7 +39,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -123,7 +124,7 @@ "4 4.6 3.4 1.4 0.3 1" ] }, - "execution_count": 5, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -134,7 +135,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -143,7 +144,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -152,7 +153,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -169,7 +170,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -178,7 +179,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -187,7 +188,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -204,7 +205,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ @@ -217,7 +218,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -226,7 +227,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -243,7 +244,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -252,7 +253,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -261,7 +262,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -270,7 +271,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -299,18 +300,16 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 21, "metadata": {}, "outputs": [ { - "ename": "NameError", - "evalue": "name 'cross_val_score' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mscores\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcross_val_score\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlr\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mall_X\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mall_y\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcv\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[0mscores\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msort\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[0maccuracy\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mscores\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmean\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mscores\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;31mNameError\u001b[0m: name 'cross_val_score' is not defined" + "name": "stdout", + "output_type": "stream", + "text": [ + "[0.85714286 0.92307692 0.92857143 0.92857143 0.93333333 0.93333333\n", + " 1. 1. 1. 1. ]\n", + "0.9504029304029304\n" ] } ], @@ -325,7 +324,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "metadata": {}, "outputs": [], "source": [ @@ -334,14 +333,14 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 23, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[1 2 1 2 2 1 2 3 3 1 3 1 2 2 3 2 2 3 1 2 2 1 3 1 1 2 1 2]\n" + "[3 3 3 3 3 3 3 3]\n" ] } ], From 597d2b5a8a5f3df87750cb7fcf8706cd5ec294a0 Mon Sep 17 00:00:00 2001 From: Rahul Date: Sat, 18 Apr 2020 17:29:25 +0530 Subject: [PATCH 37/39] iris --- IRIS.ipynb | 273 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 187 insertions(+), 86 deletions(-) diff --git a/IRIS.ipynb b/IRIS.ipynb index 1a29464..f58ec4e 100644 --- a/IRIS.ipynb +++ b/IRIS.ipynb @@ -2,44 +2,32 @@ "cells": [ { "cell_type": "code", - "execution_count": 4, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", - "from sklearn.ensemble import RandomForestClassifier\n", "from sklearn.model_selection import train_test_split\n", "from sklearn.model_selection import cross_val_score\n", - "from sklearn.externals import joblib\n", "from sklearn.naive_bayes import GaussianNB\n", "from sklearn.linear_model import LogisticRegression\n", - "import numpy as np\n", - "from sklearn.metrics import accuracy_score\n", - "from sklearn import metrics" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [], - "source": [ - "#Loading the complete File" + "from sklearn.ensemble import RandomForestClassifier\n", + "from sklearn.metrics import accuracy_score" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ - "irisCompleteData= pd.read_csv(\"C://Users//Lenovo//Documents//Desktop//IPY//iris.csv\")" + "irisCompleteData= pd.read_csv(\"C:\\\\Users\\\\Lenovo\\\\Desktop\\\\IPY\\\\MachineLearning-Python-IRIS\\\\Data\\\\iris.csv\")" ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -124,183 +112,272 @@ "4 4.6 3.4 1.4 0.3 1" ] }, - "execution_count": 7, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "irisCompleteData.head(5)" + "irisCompleteData.head()" ] }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 4, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(148, 5)\n" + ] + } + ], "source": [ - "#In the file we have total 148 records. From these records we have decided to keep 140 for training purpose." + "print(irisCompleteData.shape)" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ - "trainData = irisCompleteData.head(140)" + "# Total number of recods = 148\n", + "# Number of Records chosen for Building Model = 112\n", + "# Number of Records chosen for Testing Model = 28 (20% of 140 = 28)\n", + "# Number of Records(extra) chosen for Testing Model = 8" ] }, { - "cell_type": "code", - "execution_count": 10, + "cell_type": "markdown", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Dimensions of train: (140, 5)\n" - ] - } - ], "source": [ - "print(\"Dimensions of train: {}\".format(trainData.shape))\n" + "![image](https://user-images.githubusercontent.com/689226/79633923-20d9ce80-8185-11ea-98d3-35f348a5a23f.png)\n" ] }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ - "#The reamining 8 records will be used for testing purpose." + "analysisDataframe = irisCompleteData.head(140)" ] }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ - "untouchedTestData = irisCompleteData.tail(8)" + "untouchedDataframe = irisCompleteData.tail(8)" ] }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Dimensions of train: (8, 5)\n" + "(140, 5)\n", + "(8, 5)\n" ] } ], "source": [ - "print(\"Dimensions of train: {}\".format(untouchedTestData.shape))" + "print(analysisDataframe.shape)\n", + "print(untouchedDataframe.shape)" ] }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ - "#From the test records, we are deleting the 'class' columns.\n", - "#ONE THING IMPORTANT IS THAT WE ARE NOT DELETING FROM THE ACTUAL FILE BUT FROM THE DATAFRAME.\n", - "#ANOTHER IMPORTANT THING IS THAT- HERE WE HAVE ONE FILE WHICH WE HAVE DIVIDED INTO TWO DATAFRAMES.\n", - "#IF WE WERE GIVEN TWO FILES (TEST & TRAIN) WE COULD HAVE SIMPLY LOADED BOTH OF THEM INTO TWO DIFFERENT DATAFRAMES.\n", - "#ONE FILE | TWO FILE APPROACH MAKES NO DIFFERENCE ! " + "selectdColumns = [\"sepallength\",\"sepalwidth\",\"petallength\",\"petalwidth\"]\n", + "targetColumn = ['class']" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "

\n", + " Applying ML model:\n", + "

" ] }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ - "del untouchedTestData['class']" + "model = GaussianNB()" ] }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Dimensions of test: (8, 4)\n" + "all_X ---> (140, 4)\n", + "all_Y ---> (140, 1)\n" ] } ], "source": [ - "print(\"Dimensions of test: {}\".format(untouchedTestData.shape))" + "all_X = analysisDataframe[selectdColumns]\n", + "all_Y = analysisDataframe[targetColumn]\n", + "print(\"all_X --->\", all_X.shape)\n", + "print(\"all_Y --->\", all_Y.shape)" ] }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ - "selectdColumns = [\"sepallength\",\"sepalwidth\",\"petallength\",\"petalwidth\"]" + "train_X, test_X, train_Y, test_Y = train_test_split(\n", + " all_X, all_Y, random_state=0, test_size=0.20)" ] }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 13, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "train_X ---> (112, 4)\n" + ] + }, + { + "ename": "NameError", + "evalue": "name 'train_y' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"train_X --->\"\u001b[0m \u001b[1;33m,\u001b[0m \u001b[0mtrain_X\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"train_Y --->\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtrain_y\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"test_X --->\"\u001b[0m \u001b[1;33m,\u001b[0m \u001b[0mtest_X\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"test_Y --->\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtest_y\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mNameError\u001b[0m: name 'train_y' is not defined" + ] + } + ], "source": [ - "# Now, time to apply ML modeling." + "print(\"train_X --->\" , train_X.shape)\n", + "print(\"train_Y --->\", train_y.shape)\n", + "print(\"test_X --->\" , test_X.shape)\n", + "print(\"test_Y --->\", test_y.shape)" ] }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ - "lr = GaussianNB()" + "# This test_X-test_Y rows are random rows (not consecutive). The sum of all test_X-test_Y rows here = 28 (20% of 140 = 28)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![image](https://user-images.githubusercontent.com/689226/79636787-e3327100-8197-11ea-8d9a-de2b3358c370.png)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "

\n", + " Computing Prediction | Comparing Predicted values with test_Y values. \n", + "

" ] }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[1 2 1 2 2 1 2 3 3 1 3 1 2 2 3 2 2 3 1 2 2 1 3 1 1 2 1 2]\n", - "0.9285714285714286\n" + "Predictions : [1 2 1 2 2 1 2 3 3 1 3 1 2 2 3 2 2 3 1 2 2 1 3 1 1 2 1 2]\n", + "Actual test_Y: [1, 2, 1, 2, 2, 1, 3, 3, 3, 1, 3, 1, 2, 2, 3, 2, 3, 3, 1, 2, 2, 1, 3, 1, 1, 2, 1, 2]\n", + "Length of testY: 28 = Length of Predictions: 28\n" ] } ], "source": [ - "all_X = trainData[selectdColumns]\n", - "all_y = trainData['class']\n", + "model.fit(train_X, train_Y.values.ravel())\n", + "predictions = model.predict(test_X)\n", + "print(\"Predictions :\",predictions)\n", "\n", - "train_X, test_X, train_y, test_y = train_test_split(\n", - " all_X, all_y, random_state=0, test_size=0.20)\n", - "\n", - "\n", - "lr.fit(train_X, train_y)\n", - "predictions = lr.predict(test_X)\n", - "print(predictions)\n", + "testY =[]\n", + "for i in test_Y['class']:\n", + " testY.append(i)\n", + "print(\"Actual test_Y: \",testY)\n", + "print(\"Length of testY: \",len(test_Y),\"=\",\"Length of Predictions: \", len(predictions))" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'test_y' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0maccuracy\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0maccuracy_score\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtest_y\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mpredictions\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0maccuracy\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mNameError\u001b[0m: name 'test_y' is not defined" + ] + } + ], + "source": [ "accuracy = accuracy_score(test_y, predictions)\n", "print(accuracy)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "

\n", + " Computing Cross Validation
\n", + " As we mentioned above that test_X-test_Y rows are random rows, therefore to select different permutations/combinations of random rows, we do Cross Validation.\n", + "

" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![image](https://user-images.githubusercontent.com/689226/79636831-43c1ae00-8198-11ea-96ff-9965e9588f7d.png)" + ] + }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -314,7 +391,8 @@ } ], "source": [ - "scores = cross_val_score(lr, all_X, all_y, cv=10)\n", + "# The model here has been trained with one trial of CV. Now trying with 10 more random trials.\n", + "scores = cross_val_score(model, all_X, all_Y.values.ravel(), cv=10)\n", "scores.sort()\n", "accuracy = scores.mean()\n", "\n", @@ -323,37 +401,60 @@ ] }, { - "cell_type": "code", - "execution_count": 22, + "cell_type": "markdown", "metadata": {}, - "outputs": [], "source": [ - "predictions = lr.predict(untouchedTestData[selectdColumns])" + "
\n", + "

\n", + " Now picking untouchedDataframe!\n", + "

" ] }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[3 3 3 3 3 3 3 3]\n" + "Predictions : [3 3 3 3 3 3 3 3]\n" ] } ], "source": [ - "print(predictions)" + "predictions = model.predict(untouchedDataframe[selectdColumns])\n", + "print(\"Predictions :\",predictions)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Actual untouchedDataframe Y: 140 3\n", + "141 3\n", + "142 3\n", + "143 3\n", + "144 3\n", + "145 3\n", + "146 3\n", + "147 3\n", + "Name: class, dtype: int64\n" + ] + } + ], + "source": [ + "untouchedDataframeY =[]\n", + "for i in untouchedDataframe['class']:\n", + " untouchedDataframeY.append(i)\n", + "print(\"Actual untouchedDataframe Y: \",untouchedDataframe['class'])\n" + ] }, { "cell_type": "code", From 07650114158fc8b39e3ea337daa6523c739d5537 Mon Sep 17 00:00:00 2001 From: Rahul Date: Sat, 18 Apr 2020 17:33:14 +0530 Subject: [PATCH 38/39] iris --- IRIS.ipynb | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/IRIS.ipynb b/IRIS.ipynb index f58ec4e..59fa3dc 100644 --- a/IRIS.ipynb +++ b/IRIS.ipynb @@ -262,26 +262,18 @@ "name": "stdout", "output_type": "stream", "text": [ - "train_X ---> (112, 4)\n" - ] - }, - { - "ename": "NameError", - "evalue": "name 'train_y' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"train_X --->\"\u001b[0m \u001b[1;33m,\u001b[0m \u001b[0mtrain_X\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"train_Y --->\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtrain_y\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"test_X --->\"\u001b[0m \u001b[1;33m,\u001b[0m \u001b[0mtest_X\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"test_Y --->\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtest_y\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;31mNameError\u001b[0m: name 'train_y' is not defined" + "train_X ---> (112, 4)\n", + "train_Y ---> (112, 1)\n", + "test_X ---> (28, 4)\n", + "test_Y ---> (28, 1)\n" ] } ], "source": [ "print(\"train_X --->\" , train_X.shape)\n", - "print(\"train_Y --->\", train_y.shape)\n", + "print(\"train_Y --->\", train_Y.shape)\n", "print(\"test_X --->\" , test_X.shape)\n", - "print(\"test_Y --->\", test_y.shape)" + "print(\"test_Y --->\", test_Y.shape)" ] }, { @@ -342,19 +334,15 @@ "metadata": {}, "outputs": [ { - "ename": "NameError", - "evalue": "name 'test_y' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0maccuracy\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0maccuracy_score\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtest_y\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mpredictions\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0maccuracy\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;31mNameError\u001b[0m: name 'test_y' is not defined" + "name": "stdout", + "output_type": "stream", + "text": [ + "0.9285714285714286\n" ] } ], "source": [ - "accuracy = accuracy_score(test_y, predictions)\n", + "accuracy = accuracy_score(test_Y, predictions)\n", "print(accuracy)" ] }, @@ -463,6 +451,13 @@ "outputs": [], "source": [] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "code", "execution_count": null, From 57839eeba9b8542ff2f9f27360cacc200fde9ede Mon Sep 17 00:00:00 2001 From: Rahul Date: Sat, 18 Apr 2020 20:25:55 +0530 Subject: [PATCH 39/39] iris --- IRIS.ipynb | 69 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 9 deletions(-) diff --git a/IRIS.ipynb b/IRIS.ipynb index 59fa3dc..bc42965 100644 --- a/IRIS.ipynb +++ b/IRIS.ipynb @@ -282,14 +282,62 @@ "metadata": {}, "outputs": [], "source": [ - "# This test_X-test_Y rows are random rows (not consecutive). The sum of all test_X-test_Y rows here = 28 (20% of 140 = 28)" + "# These test_X-test_Y rows are random rows (not consecutive). The sum of all test_X-test_Y rows here = 28 (as 20% of 140 = 28)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "![image](https://user-images.githubusercontent.com/689226/79636787-e3327100-8197-11ea-8d9a-de2b3358c370.png)\n" + "![image](https://user-images.githubusercontent.com/689226/79640727-bc346900-81b0-11ea-9e86-79e3ef640bdc.png)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " sepallength sepalwidth petallength petalwidth\n", + "45 4.6 3.2 1.4 0.2\n", + "59 5.9 3.0 4.2 1.5\n", + "7 4.9 3.1 1.5 0.1\n", + "50 6.9 3.1 4.9 1.5\n", + "92 5.6 2.7 4.2 1.3\n", + "27 4.7 3.2 1.6 0.2\n", + "131 6.3 2.8 5.1 1.5\n", + "137 6.9 3.1 5.4 2.1\n", + "122 6.7 3.3 5.7 2.1\n", + "8 5.4 3.7 1.5 0.2\n", + "111 5.7 2.5 5.0 2.0\n", + "16 5.7 3.8 1.7 0.3\n", + "63 6.7 3.1 4.4 1.4\n", + "76 6.0 2.9 4.5 1.5\n", + "123 7.2 3.2 6.0 1.8\n", + "97 5.7 2.8 4.1 1.3\n", + "104 4.9 2.5 4.5 1.7\n", + "110 6.8 3.0 5.5 2.1\n", + "33 5.0 3.2 1.2 0.2\n", + "91 5.0 2.3 3.3 1.0\n", + "90 5.8 2.6 4.0 1.2\n", + "22 4.8 3.4 1.9 0.2\n", + "102 6.5 3.0 5.8 2.2\n", + "24 5.0 3.4 1.6 0.4\n", + "2 5.0 3.6 1.4 0.2\n", + "51 5.5 2.3 4.0 1.3\n", + "26 5.2 3.4 1.4 0.2\n", + "71 6.1 2.8 4.7 1.2\n", + "Length of test_X : 28\n" + ] + } + ], + "source": [ + "# Example of above diagram:\n", + "print(test_X )\n", + "print(\"Length of test_X : \", len(test_X))" ] }, { @@ -303,7 +351,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -330,7 +378,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -352,7 +400,9 @@ "source": [ "

\n", " Computing Cross Validation
\n", - " As we mentioned above that test_X-test_Y rows are random rows, therefore to select different permutations/combinations of random rows, we do Cross Validation.\n", + " As mentioned above that test_X-test_Y rows got randomly picked (Actual Representation). The sum of rows was n% of the total analysis data. Example: We mentioned 20% in train_test_split() which resulted as (20% of 140 =28) random rows.

\n", + "\n", + "In K-Fold Cross Validation, we define K as any number which divides the total analysis data into equal parts. Example: If k=10, and total number of rows = 140, then, test_X-test_Y row count will be = 14 rows. Now computation happens between the first 14 rows and rest 126 rows to calculate the accuracy score. The process repeats 10 times and at the end mean accuracy becomes the model's accuracy.  \n", "

" ] }, @@ -360,12 +410,13 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![image](https://user-images.githubusercontent.com/689226/79636831-43c1ae00-8198-11ea-96ff-9965e9588f7d.png)" + "\n", + "![image](https://user-images.githubusercontent.com/689226/79639250-390f1500-81a8-11ea-84ea-5511569f6b24.png)" ] }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -400,7 +451,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -418,7 +469,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 20, "metadata": {}, "outputs": [ {