In this experiment a nonlinear SVM is trained to solve the *Two Spirals*
problem, that is a linearly non-separable classification problem developed for benchmarking
neural networks. The classification accuracy of the nonlinear SVM is determined on the data
set.

*Two Spirals* [Two Spirals]

**Figure 8.19. The R code that produces the data set and is executed by
the Execute Script (R) operator of the
R Extension.**

i <- 0:96 angle <- i * pi / 16 radius <- 6.5 * (104 - i) / 104 x <- radius * cos(angle); y <- radius * sin(angle); spirals <- data.frame( rbind( cbind(x, y, 0), cbind(-x, -y, 1) ) ) names(spirals) <- c("x", "y", "class") spirals <- transform(spirals, class = factor(class)) spirals.label <- "class"

The R code that produces the data set is based on a SAS code snippet in [Neural Network FAQ].

The figure shows that the nonlinear SVM perfectly classifies all training examples.