Consider the Gini index, classification error, and entropy in a simple classification setting with two classes. Create a single plot that displays each of these quantities as a function of \(\hat{p}_{m1}\). The x-axis should display \(\hat{p}_{m1}\), ranging from 0 to 1, and the y-axis should display the value of the Gini index, classification error, and entropy.
Hint: In a setting with two classes, \(\hat{p}_{m1}= 1 - \hat{p}_{m2}\). You could make this plot by hand, but it will be much easier to make in R.
In the lab, a classification tree was applied to the Carseats data set
after converting Sales into a qualitative response
variable. Now we will seek to predict Sales using
regression trees and related approaches, treating the response as a
quantitative variable