View source: R/train_MLmodels.R
train_rf | R Documentation |
Trains a Random Forest regression model.
train_rf(data, formula, ntree = 500, seed = 123)
data |
A data frame containing the training data. |
formula |
A formula describing the model structure. |
ntree |
Number of trees to grow (default 500). |
seed |
Random seed for reproducibility (default 123). |
A trained randomForest model object.
library(randomForest)
data(mtcars)
rf_model <- train_rf(mtcars, mpg ~ cyl + hp + wt, ntree = 100)
print(rf_model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.