LIBSVM: a Library for Support Vector Machines
Chih-Chung Chang and Chih-Jen Lin
∗
Last updated: February 27, 2009
Abstract
LIBSVM is a library for support vector machines (SVM). Its goal is to help
users to easily use SVM as a tool. In this document, we present all its imple-
mentation details. For the use of LIBSVM, the README file included in the
package and the LIBSVM FAQ provide the information.
1 Introduction
LIBSVM is a library for support vector machines (SVM). Its goal is to let users can
easily use SVM as a tool. In this document, we present all its implementation details.
For using LIBSVM, the README file included in the package provides the information.
In Section 2, we show formulations used in LIBSVM: C-support vector classifica-
tion (C-SVC), ν-support vector classification (ν-SVC), distribution estimation (one-
class SVM), -support vector regression (-SVR), and ν-support vector regression
(ν-SVR). We discuss the implementation of solving quadratic problems in Section 3.
Section 4 describes two implementation techniques: shrinking and caching. We also
support different penalty parameters for unbalanced data. Details are in Section 5.
Then Section 6 discusses the implementation of multi-class classification. Parameter
selection is important for obtaining good SVM models. LIBSVM provides simple and
useful tools, which are discussed in Section 7. Section 8 presents the implementation
of probability outputs.
2 Formulations
2.1 C-Support Vector Classification
Given training vectors x
i
∈ R
n
, i = 1, . . . , l, in two classes, and a vector y ∈ R
l
such
that y
i
∈ {1, −1}, C-SVC (Boser et al., 1992; Cortes and Vapnik, 1995) solves the
∗
Department of Computer Science, National Taiwan University, Taipei 106, Taiwan (http://
www.csie.ntu.edu.tw/
~
cjlin). E-mail: cjlin@csie.ntu.edu.tw
1