javatools.datatypes
Class SVMModel

java.lang.Object
  extended by javatools.datatypes.SVMModel
All Implemented Interfaces:
java.io.Serializable

public class SVMModel
extends java.lang.Object
implements java.io.Serializable

This class is part of the Java Tools (see http://mpii.de/yago-naga/javatools). It is licensed under the Creative Commons Attribution License (see http://creativecommons.org/licenses/by/3.0) by the YAGO-NAGA team (see http://mpii.de/yago-naga). This class implements an SVM-light-Model. This code is the Java-translation of Thorsten Joachim's SVM-light classifier (with permission by the author), see http://svmlight.joachims.org/

See Also:
Serialized Form

Nested Class Summary
static class SVMModel.KernelType
          Defines the enum of the Kernel-type (LINEAR,POLY,RBF,SIGMOID)
 
Constructor Summary
SVMModel(java.io.File f)
          Reads the SVMModel from a SVM-light model file
SVMModel(java.lang.String f)
          Reads the SVMModel from an SVM-light model file
 
Method Summary
 double classify(SparseVector v)
          Classifies a SparseVector
 double kernel(SparseVector a, SparseVector b)
          Computes a kernel
static void main(java.lang.String[] argv)
          Test routine
 java.lang.String toString()
          Returns this model as a descriptive string
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SVMModel

public SVMModel(java.lang.String f)
         throws java.lang.Exception
Reads the SVMModel from an SVM-light model file

Throws:
java.lang.Exception

SVMModel

public SVMModel(java.io.File f)
         throws java.lang.Exception
Reads the SVMModel from a SVM-light model file

Throws:
java.lang.Exception
Method Detail

classify

public double classify(SparseVector v)
Classifies a SparseVector


kernel

public double kernel(SparseVector a,
                     SparseVector b)
Computes a kernel


toString

public java.lang.String toString()
Returns this model as a descriptive string

Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Test routine

Throws:
java.lang.Exception