0
model=ranger(mpg~.,data=mtcars)

Call:
 ranger(mpg ~ ., data = mtcars) 

Type:                             Regression 
Number of trees:                  500 
Sample size:                      32 
Number of independent variables:  10 
Mtry:                             3 
Target node size:                 5 
Variable importance mode:         none 
Splitrule:                        variance 
OOB prediction error (MSE):       5.8946 
R squared (OOB):                  0.83772

The ramdomForest package provides MSE and r2 when the xtest and ytest arguments are passed to the randomForest function. The ranger package by default provides MSE and R squared even if no test data is provided, How does the ranger package calculate MSE without training/test data? Can someone please explain?

Herman Toothrot
  • 1,463
  • 3
  • 23
  • 53

0 Answers0