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 e1071
package in R provides functions for various
machine learning algorithms including support vector machines
(SVMs).
#load data
aq <- na.omit(airquality)
# build SVM model
sv <- svm(Ozone ~ ., data = aq, kernel = "radial")
# vivid
vi <- vivi(data = aq, fit = sv, response = 'Ozone')
# Load the iris dataset
data(iris)
# Train
sv <- svm(Species ~ ., data = iris, probability = T)
vi <- vivi(data = iris, fit = sv, response = 'Species', class = 'setosa')