Solving the two spirals problem by a nonlinear SVM

Description

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.

Input

Two Spirals [Two Spirals]

Figure 8.18. The Two Spirals data set

The Two Spirals data set

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"

Note

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

Output

Figure 8.20. The classification accuracy of the nonlinear SVM on the data set.

The classification accuracy of the nonlinear SVM on the data set.

Interpretation of the results

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

Video

Workflow

svm_exp6.rmp

Keywords

SVM
supervised learning
linearly non-separable
classification

Operators

Apply Model
Performance (Classification)
Support Vector Machine (LibSVM)
Execute Script (R) [R Extension]