Another visualization into the decision tree space predictions.
<- ames_train %>%
p ggplot(aes(x = Gr_Liv_Area, y = Total_Bsmt_SF)) +
geom_point(aes(col = Sale_Price))
## Fit a decision tree using the same variables as the above plot
<- rpart(Sale_Price ~ Gr_Liv_Area + Total_Bsmt_SF, data = ames_train)
ames_dt4
+
p geom_parttree(
data = ames_dt4,
aes(fill = Sale_Price),
alpha = 0.1
+
) scale_color_viridis_c(aesthetics = c('colour', 'fill'))