29 December 2017

Would you Survive the sinking of the Titanic?

Simply enter a few details and the Shiny App will predict your probability of survival with a 94% Accuracy.

Experiment with different scenarios and see if your chances improve or deteriorate.

Click here for the Shiny App:

Click here for the Shiny App Source Code:

Instructions:

Open the Shiny App and enter the following details:

  • Sex: Male or Female
  • Ticket Class: 1st, 2nd, 3rd
  • Embarkation: Cherbourg(France), Queenstown(Now Cobh, Ireland), S'hampton(England)
  • Age: For a child less than 1 enter 0.4
  • Parent/Child: Number of your parents and children that accompanied you on your journey
  • Family Size: Total number of family that accompanied you on the journey - include yourself in the total

Additional guidelines are contained in the Shiny App input panel

The Titanic Training Dataset

The dataset used to build the prediction model looks like this:

  Pclass    Sex Age Parch Embarked Survived FSize.Category
1      3   male  22     0        S        0          Small
2      1 female  38     0        C        1          Small

Calculated accuracy of the Model using a test dataset:

model <- glm(formula=Survived ~. , family = binomial(link = "logit"), 
             data = train)
fitted.probs <- predict(model, newdata=test, type = "response")
fitted.pred <- ifelse(fitted.probs > 0.5, 1, 0)
accuracy <- mean(fitted.pred==test$Survived)
## [1] 0.9425837

Shiny App Documentation & Reproducibility

The Titanic Survival Predictor Shiny App can be found here

Full source code for this Shiny App can be found here or here at

All code for the initial titanic data exploration, data cleaning, feature engineering and model building can be found here