Book Image

Scala for Machine Learning

By : Patrick R. Nicolas
Book Image

Scala for Machine Learning

By: Patrick R. Nicolas

Overview of this book

Table of Contents (20 chapters)
Scala for Machine Learning
About the Author
About the Reviewers

Support vector classifiers – SVC

Support vector machines can be applied to classification, anomalies detection, and regression problems. Let's first dive into the support vector classifiers.

The binary SVC

The first classifier to be evaluated is the binary (2-class) support vector classifier. The implementation uses the LIBSVM library created by Chih-Chung Chang and Chih-Jen Lin from the National Taiwan University [8:9].


The library was originally written in C before being ported to Java. It can be downloaded from as a .zip or tar.gzip file. The library includes the following classifier modes:

  • Support vector classifiers (C-SVC, υ-SVC, and one-class SVC)

  • Support vector regression (υ-SVR and ε-SVR)

  • RBF, linear, sigmoid, polynomial, and precomputed kernels

LIBSVM has the distinct advantage of using Sequential Minimal Optimization (SMO), which reduces the time complexity of a training of n observations to O(n 2). The LIBSVM documentation covers both the...