Session Ready
Exercise

Visualizing classification trees

Due to government rules to prevent illegal discrimination, lenders are required to explain why a loan application was rejected.

The structure of classification trees can be depicted visually, which helps to understand how the tree makes its decisions. The model loan_model that you fit in the last exercise is in your workspace.

Instructions
100 XP
  • Type loan_model to see a text representation of the classification tree.
  • Load the rpart.plot package.
  • Apply the rpart.plot() function to the loan model to visualize the tree.
  • See how changing other plotting parameters impacts the visualization by running the supplied command.