This guide is designed as a quick-stop reference of how to use some
of the more popular machine learning R packages with vivid
.
In the following examples, we use the air quality data for regression
and the iris data for classification.
The randomForest
package in R implements the Random
Forest algorithm for classification and regression, a popular ensemble
method that builds multiple decision trees during training and
aggregates their results for predictions.
# load data
aq <- na.omit(airquality)
# build rf model
rf <- randomForest(Ozone ~ ., data = aq)
# vivid
vi <- vivi(data = aq, fit = rf, response = 'Ozone')
# Load the iris dataset
data(iris)
# Train
rf <- randomForest(Species ~ ., data = iris)
vi <- vivi(data = iris, fit = rf, response = 'Species', class = 'setosa')