Titanic Survivor Predictor

Parthiban Malan
Aug 23, 2018

About this Application

This is a Shiny application which predicts whether a passenger in the Titanic will survive the wreckage or not.

Follwoing are the passenger details that have to be provided to get the prediction.

  • Class travelled by the passenger
  • Sex of the passenger
  • Age of the passenger

Once the above details are provided and the Submit button is clicked, the application will predict and show the output at the bottom.

Note: When the application opens up, by default, it shows the prediction for the inital values.

Data Preparation & Feature Engineering

Datasets have been taken from Kaggle's Titanic competition website https://www.kaggle.com/c/titanic/data.

Pclass and Sex columns are used for building the models. A new column AgeGroup is created from Age column and the missing values in it are fixed using the title (like Miss, Master) in the Name column.

 Survived     Pclass          Sex       AgeGroup  
 0:549    Min.   :1.000   female:314   major:738  
 1:342    1st Qu.:2.000   male  :577   minor:153  
          Median :3.000                           
          Mean   :2.309                           
          3rd Qu.:3.000                           
          Max.   :3.000                           

Predictive Model Selection

Models will be created using Decision Trees and Random Forest alogithms.

Model 1 accuracy:

 Accuracy 
0.7612613 

Model 2 accuracy:

 Accuracy 
0.8018018 

The accuracy of the models are compared and the best performing model is used in the Shiny application.

Application and Code Location