View source: R/rf.mtry.optim.R
rf.mtry.optim | R Documentation |
This function calculates the optimal mtry for a given Random Forest (RF) model in a specified range of values. The optimal mtry value can then be used in the grf model.
rf.mtry.optim(formula, dataset, min.mtry=NULL, max.mtry=NULL, mtry.step,
cv.method="repeatedcv", cv.folds=10, ...)
formula |
the model to be fitted using the function |
dataset |
a numeric data frame of at least two suitable variables (one dependent and one independent) |
min.mtry |
the minimum mtry value for its optimisation (function |
max.mtry |
the maximum mtry value for its optimisation (function |
mtry.step |
the step in the sequence of mtry values for its optimisation (function |
cv.method |
the resampling method in the function |
cv.folds |
the number of folds (argument "number" in the function |
... |
additional arguments affecting the function |
Based on the train
function of the caret
package, this function sets up a grid of tuning parameters for a number of random forest routines, fits each model and calculates a resampling based performance measure to choose the best mtry value.
A list is returned of class train as in the function train
in the caret
package.
This function is under development.
Stamatis Kalogirou <stamatis.science@gmail.com>, Stefanos Georganos <sgeorgan@ulb.ac.be>
Kuhn, M. (2008). Building Predictive Models in R Using the caret Package. Journal of Statistical Software, 28(5), 1 - 26. doi: <http://dx.doi.org/10.18637/jss.v028.i05>
Georganos, S. and Kalogirou, S. (2022) A Forest of Forests: A Spatially Weighted and Computationally Efficient Formulation of Geographical Random Forests. ISPRS, International Journal of Geo-Information, 2022, 11, 471. <https://www.mdpi.com/2220-9964/11/9/471>
data(Income)
Coords <- Income[ ,1:2]
results <- rf.mtry.optim(Income01 ~ UnemrT01 + PrSect01, Income)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.