sg.edu.nus.comp.nlp.ims.classifiers
Class CLibSVMTrainer

java.lang.Object
  extended by sg.edu.nus.comp.nlp.ims.classifiers.CLibSVMTrainer
All Implemented Interfaces:
IModelTrainer

public class CLibSVMTrainer
extends java.lang.Object
implements IModelTrainer

call libsvm classifier to train model for instances of a lexelt.

Author:
zhongzhi

Field Summary
protected  libsvm.svm_parameter m_Param
           
 
Constructor Summary
CLibSVMTrainer()
          constructor
 
Method Summary
 libsvm.svm_parameter getParam()
          get parameters
 void setOptions(java.lang.String[] options)
          set options
 void setParam(libsvm.svm_parameter p_Param)
          set parameters
 java.lang.Object train(java.lang.Object p_Lexelt)
          train a model with instances in p_Lexelt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Param

protected libsvm.svm_parameter m_Param
Constructor Detail

CLibSVMTrainer

public CLibSVMTrainer()
constructor

Method Detail

setOptions

public void setOptions(java.lang.String[] options)
Description copied from interface: IModelTrainer
set options

Specified by:
setOptions in interface IModelTrainer
Parameters:
options - options

train

public java.lang.Object train(java.lang.Object p_Lexelt)
                       throws java.lang.Exception
Description copied from interface: IModelTrainer
train a model with instances in p_Lexelt

Specified by:
train in interface IModelTrainer
Parameters:
p_Lexelt - lexelt
Returns:
model
Throws:
java.lang.Exception - train exception

setParam

public void setParam(libsvm.svm_parameter p_Param)
set parameters

Parameters:
p_Param - parameters

getParam

public libsvm.svm_parameter getParam()
get parameters

Returns:
parameters