LIBLINEAR -- A Library for Large Linear Classification

Machine Learning Group at National Taiwan University
Contributors


We plan to include linear regression solvers but urgently need some data for evaluation. Please kindly contact us if you have large and sparse regression data. Thank you.
Version 1.8 released on April Fools' day, 2011. An extension for large data which cannot fit in memory is available at LIBSVM Tools. See our KDD 2010 paper.
See also other liblinear extensions ("Weights for data instances" and "fast training/testing for degree-2 polynomial mappings of data") at LIBSVM Tools.
LIBLINEAR is the winner of ICML 2008 large-scale learning challenge (linear SVM track). It is also used for winning KDD Cup 2010.

Introduction

LIBLINEAR is a linear classifier for data with millions of instances and features. It supports

Main features of LIBLINEAR include

Documentation

FAQ is here


When to use LIBLINEAR but not LIBSVM

There are some large data for which with/without nonlinear mappings gives similar performances. Without using kernels, one can quickly train a much larger set via a linear classifier. Document classification is one such application. In the following example (20,242 instances and 47,236 features; available on LIBSVM data sets), the cross-validation time is significantly reduced by using LIBLINEAR:
% time libsvm-2.85/svm-train -c 4 -t 0 -e 0.1 -m 800 -v 5 rcv1_train.binary
Cross Validation Accuracy = 96.8136%
345.569s
% time liblinear-1.21/train -c 4 -e 0.1 -v 5 rcv1_train.binary
Cross Validation Accuracy = 97.0161%
2.944s
Warning:While LIBLINEAR's default solver is very fast for document classification, it may be slow in other situations. See Appendix C of our SVM guide about using other solvers in LIBLINEAR.

Warning:If you are a beginner and your data sets are not large, you should consider LIBSVM first.


Download LIBLINEAR

The current release (Version 1.8, April 2011) of LIBLINEAR can be obtained by downloading the zip file or tar.gz file.

The package includes the source code in C/C++. A README file with detailed explanation is provided. For MS Windows users, there is a subdirectory in the zip file containing binary executable files.

Please read the COPYRIGHT notice before using LIBLINEAR


Documentation and Codes used for experiments in our papers

General information
R.-E. Fan, K.-W. Chang, C.-J. Hsieh, X.-R. Wang, and C.-J. Lin. LIBLINEAR: A library for large linear classification Journal of Machine Learning Research 9(2008), 1871-1874.

Some examples are in Appendix C of our SVM guide.

The approach for dual L2-regularize L1-loss and L2-loss SVM is a coordinate descent method:
C.-J. Hsieh, K.-W. Chang, C.-J. Lin, S. S. Keerthi, and S. Sundararajan. A dual coordinate descent method for large-scale linear SVM. ICML 2008.

Multiclass classification for Crammer and Singer's formula:
S. S. Keerthi, S. Sundararajan. K.-W. Chang, C.-J. Hsieh, and C.-J. Lin, A sequential dual method for large scale multi-class linear SVMs . KDD 2008.

For primal L2-regularized LR and L2-loss SVM, we implement a trust region Newton method:
C.-J. Lin, R. C. Weng, and S. S. Keerthi. Trust region Newton method for large-scale logistic regression. Journal of Machine Learning Research 9(2008), 627--650.

For L1-regularized LR and L2-loss SVM, we implement a primal coordinate descent metnod:
G.-X. Yuan, K.-W. Chang, C.-J. Hsieh, and C.-J. Lin. A comparison of optimization methods and software for large-scale L1-regularized linear classification . To appear in Journal of Machine Learning Research.

Code used for experiments in our LIBLINEAR papers can be found here.


Interfaces to LIBLINEAR

Language Description Maintainers and Their Affiliation Supported LIBLINEAR version Link
MATLAB A simple MATLAB interface LIBLINEAR authors at National Taiwan University. The latest Included in LIBLINEAR package
Octave A simple Octave interface LIBLINEAR authors at National Taiwan University. The latest Included in LIBLINEAR package
Java Java version of LIBLINEAR Benedikt Waldvogel 1.5 Java LIBLINEAR
Python A python interface has been included in LIBLINEAR since version 1.6. LIBLINEAR authors at National Taiwan University. The latest Included in LIBLINEAR package
Python Python wrapper of LIBLINEAR Uwe Schmitt 1.32 Zip/tar.gz file
Ruby A Ruby interface via SWIG Tom Zeng 1.51 liblinear-ruby-swig
Weka Weka wrapper Benedikt Waldvogel 1.5 Weka LIBLINEAR
R R interface to LIBLINEAR Thibault Helleputte 1.8 R LIBLINEAR
Scilab   Holger Nahrstaedt from the Technical University of Berlin 1.8 Scilab interface


Please send comments and suggestions to Chih-Jen Lin.