Titanic Survival Prediction

App to predict who survived onboard Titanic using Random Forest Algorithm

Bimal Mehta

Introduction

The sinking of the RMS Titanic is one of the most infamous shipwrecks in history. On April 15, 1912, during her maiden voyage, the Titanic sank after colliding with an iceberg, killing 1502 out of 2224 passengers and crew.

The app that I have built, allows you to do the analysis of what sorts of people were likely to survive.

In particular, this app allows you to select the characteristics of the passenger based on which the app uses machine learning to predict which passengers survived the tragedy.

This app was inspired by the kaggle challenge on Titanic Survivors

Data & Variables

This app uses train data available at the kaggle website. Alternatively the user can download the data from the app using the download button provided. The variables available are shown below

trainData <- read.csv("train.csv",comment.char="", quote="\"", sep=",", header=TRUE)
names(trainData)
##  [1] "PassengerId" "Survived"    "Pclass"      "Name"        "Sex"        
##  [6] "Age"         "SibSp"       "Parch"       "Ticket"      "Fare"       
## [11] "Cabin"       "Embarked"

The survived column above tells whether the person survives or not. Out of the given variables this app makes prediction based on Age, Embarked, Pclass, SibSp, Parch and Cabin variables.

Machine Learning & Prediction

The machine learning algorithm that the app uses to predict the Survivors is Random Forest

Random Forest was used as it provides a good ensembling of decision trees and regression to make Survival prediction.

K-Fold Cross Validation method was used to get a higher accuracy.

Several Variables (like SibSp, Parch) were combined and converted to Binary variables which gives better outcomes in terms of accuracy and avoids over-fitting.

App Features

The app is useful to anyone who is interested to analyze titanic data or is participating in kaggle challenge.

Based on just a few clicks the user can predict the fate of a person onboard Titanic with 85% accuracy.

The app not only gives whether the person survived or not but also gives the probability of his survival. The app documentation tells you how this decision is made.

The app also provides you with the list of passengers that you selected and their fate based on the selection that a user makes.

The app also has a download button which allows you to download the entire train data and save it on your local desktop to do more analysis.

Start Predicting!