1
$\begingroup$

Probably a simple question: how may I to retrieve the Mean of squared residuals of regression when using randomForest?

Thank you!

$\endgroup$
  • $\begingroup$ Questions solely about how software works are off-topic here, but you may have a real statistical question buried here. You may want to edit your question to clarify the underlying statistical issue. You may find that when you understand the statistical concepts involved, the software-specific elements are self-evident or at least easy to get from the documentation. $\endgroup$ – gung - Reinstate Monica Sep 1 '16 at 7:56
0
$\begingroup$

Can you provide more details on what software or tool you are using? depending on how you are running your randomforest- i.e if through cross validation and caret package, you can specify the RMSE as your metric: metric="RMSE"

$\endgroup$
  • $\begingroup$ OK ,I'll take RMSE to compare the real value and prevalues $\endgroup$ – E. Song Sep 1 '16 at 12:34
0
$\begingroup$

You can calulate manually if need be: something along the lines of

## model is your model object
## data is your data, with response column "response"
predValues <- predict(model,data)
mean((predValues-data$response)^2)
## alternatively, sqrt() of the above expression
$\endgroup$
  • $\begingroup$ thank you very much. I have not noticed the predValues of model $\endgroup$ – E. Song Sep 1 '16 at 12:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.