svmVivid.Rmd
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')
viviHeatmap(mat = vi)
pdpPairs(data = aq,
fit = sv,
response = "Ozone",
nmax = 500,
gridSize = 20,
nIce = 100)
# Load the iris dataset
data(iris)
# Train
sv <- svm(Species ~ ., data = iris, probability = T)
vi <- vivi(data = iris, fit = sv, response = 'Species', class = 'setosa')
viviHeatmap(mat = vi)
pdpPairs(data = iris,
fit = sv,
response = "Species",
nmax = 50,
gridSize = 4,
nIce = 10,
class = 'setosa')