set.seed(40)
x <- rbind(
matrix(rnorm(20, -2, 0.2), ncol = 2),
matrix(rnorm(20, 0, 0.2), ncol = 2),
matrix(rnorm(20, 2, 0.2), ncol = 2)
)
y <- factor(rep(c("a", "b", "c"), each = 10))
fit <- tsvm(x, y, kernel = "linear")
predict(fit, x[1:3, , drop = FALSE])
Run the code above in your browser using DataLab