Session Ready
Exercise

Passenger Title and survival rate

Was it coincidence that upper-class Rose survived and third-class passenger Jack not? Let's have a look...

You have access to a new train and test set named train_new and test_new. These data sets contain a new column with the name Title (referring to Miss, Mr, etc.). Title is another example of feature engineering: it's a new variable that possibly improves the model.

Instructions
100 XP
  • Finish the command to create a decision tree my_tree_five: make sure to include the Title variable, and to create the tree based on train_new.
  • Visualize my_tree_five with fancyRpartPlot(). Notice that Title appears in one of the nodes.
  • Finish the predict() call to create my_prediction: the function should use my_tree_five and test_new to make predictions.
  • The code that creates a data frame my_solution and writes it to a CSV file is included: these steps make the solution ready for a submission on Kaggle.