Visualizing a Tuned Classification Tree

Building on your knowledge of model tuning, train a tuned CART classification decision tree and visualize the model.

Specifying hyperparameter values

Assume a grid search has been performed using a CART classification decision tree on the Titanic training data. The grid search was used to find an optimal value for the min_n hyperparameter, given a value of 0.0 for the cost_complexity hyperparameter.

The grid search results suggest a min_n value of 14 representing an effective bias-variance tradeoff based on the accuracy, sensitivity, and specificity metrics scores. The following code implements a tidymodels workflow for training a CART classification decision tree using the Titanic training data and these hyperparameter values.

Get hands-on with 1400+ tech skills courses.