We will be using this lab to explore decision trees and random forests using the palmerpenguins
package. We will also use a couple of other packages such as rpart.plot
, rpart
, ranger
, and vip
.
Fit a decision tree using decision_tree()
, and visualize the structure of the tree.
Try different values of the hyperparameters for the tree and see how the shape of the tree changes.
Use the vip
package to showcase the variable importance.
Fit a random forest model using rand_forest()
. What Do you see in the output?
Use the vip
package to showcase the variable importance for the random forest.