Efficient training of Support Vector Machines in Java
Mailbox
as the labels. That would allow you to write something like mySvmSolutionModel.predict(incomingEmail).addMessage(incomingEmail)
. The predict()
method returns a classification label, which in this case is an object of class Mailbox
, which has an addMessage()
method.This is beta code. While LIBSVM is stable, it's possible that I broke something in the process of refactoring it. I've done ad-hoc testing primarily with the C_SVC machine and an RBF kernel, and got results that were identical to LIBSVM as far as I could tell. There are not (yet?) any unit tests. I'm running some automated verifications that jlibsvm behaves identically to LIBSVM for a number of input datasets and parameter choices; results will be available here soon. Please let me know if you find a situation in which the two packages give different results.
Sorry, I haven't really had a chance to write any docs. Have a look at the sources for the command-line programs in the legacyexec package to see how jlibsvm gets called. Very briefly, you'll need to:
SVM.train(problem)
to yield a SolutionModel, which can be used to make predictionsMaven is by far the easiest way to make use of jlibsvm. Just add these to your pom.xml:
<repositories>
<repository>
<id>dev.davidsoergel.com releases</id>
<url>http://dev.davidsoergel.com/nexus/content/repositories/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>dev.davidsoergel.com snapshots</id>
<url>http://dev.davidsoergel.com/nexus/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>edu.berkeley.compbio</groupId>
<artifactId>jlibsvm</artifactId>
<version>0.911</version>
</dependency>
</dependencies>
If you really want just the jar, you can get the latest release from the Maven repo; or get the latest stable build from the build server.