edu.cmu.minorthird.classify.algorithms.svm
Class VisibleSVM

java.lang.Object
  extended by edu.cmu.minorthird.classify.algorithms.svm.VisibleSVM
All Implemented Interfaces:
Visible, java.io.Serializable

public class VisibleSVM
extends java.lang.Object
implements Visible, java.io.Serializable

VisibleSVM processes the svm_model from LIBSVM into recognizabled formats, and visible GUI in MINORTHIRD. For example, each svm_node of svm_model is converted to Feature object in MINORTHIRD corresponding to the feature information stored in FeatureIdFactory. Each support vector of svm_model is converted to Example object in MINORTHIRD.

Author:
chiachi
See Also:
Serialized Form

Constructor Summary
VisibleSVM(libsvm.svm_model model, FeatureFactory factory)
          Constructor for the svm_model returned from SVMClassifier LIBSVM training.
VisibleSVM(libsvm.svm_model model, FeatureFactory factory, ExampleSchema schema)
          Constructor for the svm_model returned from MultiClassSVMClassifier LIBSVM training.
 
Method Summary
 Example[] getExamples()
          Get Support Vectors of svm_model in array of MINORTHIRD Example format.
 java.lang.String[][] getExampleWeightLabels()
          Get Weight Labels of Example return m X n String array, m = # of examples, n = # of corresponding hyperplanes
 Hyperplane getHyperplane(int index)
          Get Hyperplane from the Hyperplane array
 java.lang.String getHyperplaneLabel(int index)
          Get Hyperplane label from the Hyperplane labels array
 Viewer toGUI()
          GUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisibleSVM

public VisibleSVM(libsvm.svm_model model,
                  FeatureFactory factory)
Constructor for the svm_model returned from SVMClassifier LIBSVM training.

Parameters:
model - svm_model returned from LIBSVM training
factory - FeatureFactory which has Feature's id and corresponding information before converted into svm_node in svm_problem for LIBSVM training

VisibleSVM

public VisibleSVM(libsvm.svm_model model,
                  FeatureFactory factory,
                  ExampleSchema schema)
Constructor for the svm_model returned from MultiClassSVMClassifier LIBSVM training.

Parameters:
model - svm_model returned from LIBSVM training
factory - FeatureFactory which has Feature's id and corresponding information before converted into svm_node in svm_problem for LIBSVM training
schema - ExampleSchema which has class label information
Method Detail

getExamples

public Example[] getExamples()
Get Support Vectors of svm_model in array of MINORTHIRD Example format.

Returns:
Example[] array of MINORTHIRD Example consctructed from SVs of svm_model

getExampleWeightLabels

public java.lang.String[][] getExampleWeightLabels()
Get Weight Labels of Example return m X n String array, m = # of examples, n = # of corresponding hyperplanes


getHyperplane

public Hyperplane getHyperplane(int index)
Get Hyperplane from the Hyperplane array


getHyperplaneLabel

public java.lang.String getHyperplaneLabel(int index)
Get Hyperplane label from the Hyperplane labels array


toGUI

public Viewer toGUI()
GUI

Specified by:
toGUI in interface Visible