> Home > Downloads > LIBSVM-Linear


LIBSVM is a very widely used implementation of support vector machine (SVM), used in many classification tasks. It comes with an officially maintained Java version that is included in each new latest release. Unfortunately, it is not optimized when the linear kernel is used. In particular, LIBSVM uses the dual formulation of the SVM problem to classify instances regardless of the kernel used, and as such it takes O(N × n) time to classify an instance, where N is the number of support vectors in the trained model and n is the number of features in the classification problem. This makes classification unusually slow for a linear SVM when the trained model contains a large number of support vectors. Instead, classifying an instance using a linear SVM should take only O(n) time, using the primal formulation of the SVM problem.

The LIBSVM-Linear Java package provides methods for transforming a trained linear LIBSVM model, represented using the dual formulation, into an equivalent LIBSVM-Linear classification model represented in the primal formulation with explicit weight vectors. It also provides methods for classifying instances more efficiently using the LIBSVM-Linear model. As far as practicable, the methods are given the same name and signatures as those in LIBSVM.

Although the authors of LIBSVM suggested the use of LIBLINEAR for certain kinds of linear classification problems, it should be noted that LIBSVM and LIBLINEAR models are not compatible for multiclass problems: LIBSVM uses one-against-one for multiclass problems, while LIBLINEAR uses one-against-all. As such, linear LIBSVM models with three classes or more cannot be converted to LIBLINEAR models.

Oracle Java 1.6 is required to use this package.


The search engine wrapper is open source. All releases are licensed under a Modified BSD License.


This package is under general release.


Release: 2013 August 12

This is the initial release of LIBSVM-Linear.