| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectemolib.util.proc.TextDataProcessor
emolib.classifier.Classifier
emolib.classifier.machinelearning.SupportVectorMachine
public class SupportVectorMachine
The SupportVectorMachine class is a SVM classifier.
It is a large-margin discriminative approach that searches the hyperplane (decision surface in feature space) that is maximally distant from the class-wise data points. Since the SVM is a dichotomous classifier, a multicategorisation strategy has to be considered to deal with the three sentiment classes. SVM is tentatively believed to be superior with respect to other methods in situations with (enough) few training data.
The core implementation of this SVM is based on Weka's Sequential Minimal Optimisation (SMO) algorithm. Multi-class problems are solved using pairwise classification. The same term weighting schemes as the ones used in the ARN-R are considered.
ARNReduced| Constructor Summary | |
|---|---|
| SupportVectorMachine()Main constructor of this SVM classifier. | |
| Method Summary | |
|---|---|
|  java.lang.String | getCategory(FeatureBox inputFeatures)The function that decides the most appropriate emotional category. | 
|  void | load(java.lang.String path)Generic function to load a previously saved classifier. | 
|  void | resetExamples()Method to reset the classifier and flush the training examples. | 
|  void | save(java.lang.String path)Generic method to save the fully fledged classifier into a given file path. | 
|  void | setChi2(boolean chi,
        int numF)Set the Chi square feature selection. | 
|  void | setCOF(boolean cof)Method to consider bigram frequencies. | 
|  void | setEmotionDims(boolean emodims)Method to consider emotion dimensions. | 
|  void | setExponent(double expo)Method to set the exponent of the polynomial kernel. | 
|  void | setIntercept(boolean intercept)Method to consider the intercept feature. | 
|  void | setLowerOrderTerms(boolean lot)Method to set the use of lower terms in the kernel. | 
|  void | setMI(boolean mi,
      int numF)Set the Mutual Information feature selection. | 
|  void | setNegation(boolean neg)Method to consider negations. | 
|  void | setNormalisedPolyK(boolean npk)Method to use the Normalized Polynomial kernel. | 
|  void | setPOS(boolean pos)Method to consider POS tags. | 
|  void | setRBF(boolean flag)Method to use the Radial Basis Function kernel. | 
|  void | setStemming(boolean stems)Method to consider stems. | 
|  void | setSynonyms(boolean syns)Method to consider synonyms. | 
|  void | setTermWeighingMeasure(java.lang.String twm)Method to set the TW method. | 
|  void | setTF(boolean tf,
      int numF)Set the Term Frequency feature selection. | 
|  void | simpleClassification()Functionality test. | 
|  void | trainingProcedure()Training method based on the Stochastic Gradient Descent. | 
| Methods inherited from class emolib.classifier.Classifier | 
|---|
| applyClassification, getData, getListOfExampleCategories, getListOfExampleFeatures, initialize, inputTrainingExample, newProperties, register, train | 
| Methods inherited from class emolib.util.proc.TextDataProcessor | 
|---|
| flush, getName, getPredecessor, setPredecessor, toString | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
|---|
public SupportVectorMachine()
| Method Detail | 
|---|
public java.lang.String getCategory(FeatureBox inputFeatures)
Classifier
getCategory in class ClassifierinputFeatures - The input emotional features.
public void trainingProcedure()
trainingProcedure in class Classifierpublic void setExponent(double expo)
expo - The exponent.public void setLowerOrderTerms(boolean lot)
lot - The lower order terms.
public void setMI(boolean mi,
                  int numF)
mi - The Mutual Information flag.numF - The number of relevant features desired.
public void setChi2(boolean chi,
                    int numF)
chi - The Chi2 flag.numF - The number of relevant features desired.
public void setTF(boolean tf,
                  int numF)
tf - The Term Frequency flag.numF - The number of relevant features desired.public void setNormalisedPolyK(boolean npk)
npk - Set the NPK.public void setRBF(boolean flag)
flag - Set the RBF.public void setTermWeighingMeasure(java.lang.String twm)
twm - The TW method.public void setCOF(boolean cof)
cof - The COF flag.public void setPOS(boolean pos)
pos - The POS flag.public void setStemming(boolean stems)
stems - The stemming flag.public void setIntercept(boolean intercept)
intercept - The intercept flag.public void setSynonyms(boolean syns)
syns - The synonyms flag.public void setEmotionDims(boolean emodims)
emodims - The emotion dimensions flag.public void setNegation(boolean neg)
neg - The negation flag.public void save(java.lang.String path)
Classifier
save in class Classifierpath - The file path to save the classifier.public void load(java.lang.String path)
Classifier
load in class Classifierpath - The path of the file which contains the previously saved
 classifier.public void resetExamples()
Classifier
resetExamples in class Classifierpublic void simpleClassification()
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||