Can I calculate the mean square error of the results of a regression tree

Hello everyone. I am working with the wine quality dataset.I have made different regression trees as follow:

library(rpart)
library(rpart.plot)
library(rattle)
library(naniar)
library(dplyr)
library(ggplot2)

vinos <- read.csv(file = 'Wine.csv', header = T)

arbol0<-rpart(formula=quality~chlorides, data=vinos, method="anova")
fancyRpartPlot(arbol0)

arbol1<-rpart(formula=quality~chlorides+density, data=vinos, method="anova")
fancyRpartPlot(arbol1)

I want to calculate the mean square error to see how it improves with extra variables, but I don't know how to do it. Can someone please help me?

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.