randomForest.model <- function(preProcess = NULL,
description = NULL, ...)
{
library(randomForest)
function()
{
model.name <- "randomForest"
model_ <- NULL
train_ <- function(X_train, y)
{
model_ <<- randomForest(x = X_train, y, ...)
invisible()
}
predict_ <- function(X_test)
{
predictions <- predict(model_, X_test, type="prob")
predictions <- rename.prediction.columns(predictions, model.name)
predictions
}
list(
train_ = train_,
predict_ = predict_,
name = model.name,
description = description
)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.