|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthhreco.classification.SVMClassifier
This class uses libsvm, a SVM software library written in Java, to do SVM classification. [1]
[1]Chih-Chung Chang and Chih-Jen Lin http://www.csie.ntu.edu.tw/~cjlin/libsvm
Constructor Summary | |
SVMClassifier(boolean normalizeScale)
Create a SVM Classifier with default parameters and specify whether the data needs to be scaled. |
|
SVMClassifier(boolean normalizeScale,
libsvm.svm_parameter p)
Create a SVM Classifier, specify whether the data needs to be scaled, and use the given set of parameters for the SVM classifier. |
Method Summary | |
Classification |
classify(FeatureSet fs)
Classify the given example using SVM. |
void |
clear()
Clear all results of previous trainings (presumably so that this classifier can be trained again from scratch). |
static libsvm.svm_parameter |
defaultSVMParam()
Set up the default set of parameters for the SVM classifier. |
boolean |
isIncremental()
Not an incremental classifier. |
FeatureSet |
scale(FeatureSet fvals)
Scale the given feature vector based on the scale obtained from the training set. |
TrainingSet |
scale(TrainingSet tset,
int min,
int max)
Scale the feature values in the training set to be in the range of [min,max]. |
void |
train(TrainingSet tset,
int numFeatures)
Convert TraininSet examples into libsvm data structure, build a svm_problem object for the training set, and call svm_train to compute the svm model. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SVMClassifier(boolean normalizeScale)
public SVMClassifier(boolean normalizeScale, libsvm.svm_parameter p)
Method Detail |
public Classification classify(FeatureSet fs) throws ClassifierException
classify
in interface Classifier
ClassifierException
public void train(TrainingSet tset, int numFeatures) throws ClassifierException
train
in interface TrainableClassifier
ClassifierException
public static libsvm.svm_parameter defaultSVMParam()
public FeatureSet scale(FeatureSet fvals)
public TrainingSet scale(TrainingSet tset, int min, int max)
public boolean isIncremental()
isIncremental
in interface TrainableClassifier
public void clear()
TrainableClassifier
clear
in interface TrainableClassifier
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |