Description Usage Arguments Value See Also Examples
Starting with the default value of mtry, search for the optimal value (with respect to OutofBag error estimate) of mtry for randomForest.
1 2 
x 
matrix or data frame of predictor variables 
y 
response vector (factor for classification, numeric for regression) 
mtryStart 
starting value of mtry; default is the same as in

ntreeTry 
number of trees used at the tuning step 
stepFactor 
at each iteration, mtry is inflated (or deflated) by this value 
improve 
the (relative) improvement in OOB error must be by this much for the search to continue 
trace 
whether to print the progress of the search 
plot 
whether to plot the OOB error as function of mtry 
doBest 
whether to run a forest using the optimal mtry found 
... 
options to be given to 
If doBest=FALSE
(default), it returns a matrix whose first
column contains the mtry values searched, and the second column the
corresponding OOB error.
If doBest=TRUE
, it returns the randomForest
object produced with the optimal mtry
.
1 2 
randomForest 4.612
Type rfNews() to see new features/changes/bug fixes.
mtry = 3 OOB error = 21.96%
Searching left ...
mtry = 2 OOB error = 23.36%
0.06382979 0.05
Searching right ...
mtry = 4 OOB error = 24.3%
0.106383 0.05
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.