This is a Java version of the original LIBLINEAR C++ sources.
News
- 2011-06-02: ported version 1.8.
It's also available in the Maven
repository.
Note: The package name changed from liblinear to de.bwaldvogel.liblinear which was necessary to release it in the Maven repository.
- 2010-11-18: ported version 1.6 and 1.7
- 2010-02-19: intial port of liblinear with instance weight support. See Weights for data instances.
Note: Version 1.51-weights is probably slower than 1.51.
- 2009-11-12: released version 1.5 that contains all changes of the C++ version.
- 2009-07-19: added getFeatureWeights() to the Model class.
- 2009-05-12: fixed a bug
in Linear.crossValidation().
Thanks to Zeno Gantner for reporting it.
Downloads
https://github.com/bwaldvogel/liblinear-java/downloadsMaven
Liblinear is available via the official Maven repository since version 1.8.<dependency> <groupId>de.bwaldvogel</groupId> <artifactId>liblinear</artifactId> <version>1.8</version> </dependency>
Documentation
Usage
The usage is pretty similar to the usage of the C++ version. It can be used as Java library or standalone.
Example:
# java -cp liblinear-1.8.jar liblinear.Train -v 5 rcv1_train.binary
time: 2612 ms
correct: 19653
Cross Validation Accuracy = 97.0902%
Source code & development
The source code is hosted and maintained on github:
https://github.com/bwaldvogel/liblinear-java
Weka wrapper
There exists a Weka wrapper since version 3.6.
See https://github.com/bwaldvogel/liblinear-weka for more Information.