Session Ready
Exercise

Compare models with a different splitting criterion

Train two models that use a different splitting criterion and use the validation set to choose a "best" model from this group. To do this you'll use the parms argument of the rpart() function. This argument takes a named list that contains values of different parameters you can use to change how the model is trained. Set the parameter split to control the splitting criterion.

Instructions
100 XP

The datasets credit_test and credit_train have already been loaded for you.

  • Train a model, splitting the tree based on gini index.
  • Train a model, splitting the tree based on information index.
  • Generate predictions on the validation set using both models.
  • Classification error is the fraction of incorrectly classified instances. Compute and compare the test set classification error of the two models by using the ce() function.