Description
LIBLINEAR is a powerful and efficient C/C++ library designed for large-scale linear classification and regression tasks. It is particularly well-suited for datasets that contain millions of instances and features, making it an ideal choice for applications where computational efficiency is paramount. The library supports a range of L1 and L2 regularized classifiers, including linear Support Vector Machines (SVM) and logistic regression (LR). For L1-regularized classifiers, it supports linear SVM and logistic regression. Since version 1.9, it also includes L2-regularized support vector regression (SVR) with both L2-loss and L1-loss, and as of version 2.40, L2-regularized one-class support vector machines.
Key features of LIBLINEAR include its compatibility with the data format and usage patterns of LIBSVM, a general-purpose SVM solver. It provides robust support for multi-class classification through one-vs-the-rest strategies and the Crammer & Singer method. For model evaluation and selection, LIBLINEAR offers cross-validation capabilities and automatic parameter selection. It can also provide probability estimates for logistic regression models and allows for the weighting of unbalanced data to improve performance on imbalanced datasets.
LIBLINEAR is highly versatile, offering interfaces for popular programming languages such as MATLAB, Octave, Java, Python, and Ruby. Installation is streamlined through package managers like pip for Python and vcpkg for C++. The library is recognized for its speed, having won the ICML 2008 large-scale learning challenge (linear SVM track) and being used in winning solutions for KDD Cup 2010. It is especially effective for applications like document classification where linear models perform comparably to non-linear ones, significantly reducing training time.
The library is actively maintained, with recent versions focusing on improving installation processes, fixing interface issues, and enhancing solver performance. For instance, version 2.42 introduced direct switching to a primal Newton solver when dual CD solvers reach their iteration limit, and version 2.43 added support for Python interface installation via PyPI. The latest release, version 2.50, includes updated settings for building wheels and minor fixes in the Python interface. LIBLINEAR is an open-source project, encouraging community contributions and development.
LIBLINEAR's Core Features
Supports L2-regularized linear SVM, L1-loss linear SVM, and logistic regression
Includes L1-regularized linear SVM and logistic regression (after v1.4)
Offers L2-regularized support vector regression (SVR) with L2 and L1 loss (after v1.9)
Implements L2-regularized one-class support vector machines (after v2.40)
Utilizes the same data format and similar usage as LIBSVM
Supports multi-class classification using one-vs-the-rest and Crammer & Singer methods
Provides cross-validation for model evaluation
Features automatic parameter selection
Capable of generating probability estimates for logistic regression
Allows for weights for unbalanced data
Available with MATLAB, Octave, Java, Python, and Ruby interfaces
Installation supported via package managers like pip and vcpkg
Multi-core support for significant training speedup on shared-memory systems
Getting Started with LIBLINEAR
Installation: Install via package managers (e.g., `pip install -U liblinear-official` for Python, or use vcpkg for C++).
Data Preparation: Format your data according to LIBLINEAR's specifications, similar to LIBSVM.
Model Training: Use the `train` command-line tool or the provided interfaces to train linear classifiers or regressors.
Parameter Tuning: Employ cross-validation and automatic parameter selection features to find optimal hyperparameters.
Prediction: Utilize the trained model for making predictions on new data instances.
Integration: Integrate LIBLINEAR into your applications using available language interfaces (Python, Java, MATLAB, etc.).
LIBLINEAR's Use Cases
- Document Classification
- Large-Scale Regression
- Spam Detection
- Image Feature Classification
- Recommendation Systems
- Bioinformatics




