|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.functions.SMO.BinarySMO
Class for building a binary support vector machine.
Field Summary | |
private double[] |
m_alpha
The Lagrange multipliers. |
private double |
m_b
The thresholds. |
private double |
m_bLow
The thresholds. |
private double |
m_bUp
The thresholds. |
private double[] |
m_class
The transformed class values. |
private Instances |
m_data
The training data. |
private double[] |
m_errors
The current set of errors for all non-bound examples. |
private SMOset |
m_I0
The five different sets used by the algorithm. |
private SMOset |
m_I1
|
private SMOset |
m_I2
|
private SMOset |
m_I3
|
private SMOset |
m_I4
|
private int |
m_iLow
The indices for m_bLow and m_bUp |
private int |
m_iUp
The indices for m_bLow and m_bUp |
private Kernel |
m_kernel
Kernel to use |
private Logistic |
m_logistic
Stores logistic regression model for probability estimate |
private int[] |
m_sparseIndices
|
private double[] |
m_sparseWeights
Variables to hold weight vector in sparse form. |
private double |
m_sumOfWeights
Stores the weight of the training instances |
private SMOset |
m_supportVectors
The set of support vectors |
private double[] |
m_weights
Weight vector for linear machine. |
Constructor Summary | |
private |
SMO.BinarySMO()
|
Method Summary | |
private void |
buildClassifier(Instances insts,
int cl1,
int cl2,
boolean fitLogistic,
int numFolds,
int randomSeed)
Method for building the binary classifier. |
private void |
checkClassifier()
Quick and dirty check whether the quadratic programming problem is solved. |
private boolean |
examineExample(int i2)
Examines instance. |
private void |
fitLogistic(Instances insts,
int cl1,
int cl2,
int numFolds,
java.util.Random random)
Fits logistic regression model to SVM outputs analogue to John Platt's method. |
private double |
SVMOutput(int index,
Instance inst)
Computes SVM output for given instance. |
private boolean |
takeStep(int i1,
int i2,
double F2)
Method solving for the Lagrange multipliers for two instances. |
java.lang.String |
toString()
Prints out the classifier. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private double[] m_alpha
private double m_b
private double m_bLow
private double m_bUp
private int m_iLow
private int m_iUp
private Instances m_data
private double[] m_weights
private double[] m_sparseWeights
private int[] m_sparseIndices
private Kernel m_kernel
private double[] m_class
private double[] m_errors
private SMOset m_I0
private SMOset m_I1
private SMOset m_I2
private SMOset m_I3
private SMOset m_I4
private SMOset m_supportVectors
private Logistic m_logistic
private double m_sumOfWeights
Constructor Detail |
private SMO.BinarySMO()
Method Detail |
private void fitLogistic(Instances insts, int cl1, int cl2, int numFolds, java.util.Random random) throws java.lang.Exception
insts
- the set of training instancescl1
- the first class' indexcl2
- the second class' index
java.lang.Exception
- if the sigmoid can't be fit successfullyprivate void buildClassifier(Instances insts, int cl1, int cl2, boolean fitLogistic, int numFolds, int randomSeed) throws java.lang.Exception
insts
- the set of training instancescl1
- the first class' indexcl2
- the second class' indexfitLogistic
- true if logistic model is to be fitnumFolds
- number of folds for internal cross-validation
java.lang.Exception
- if the classifier can't be built successfullyprivate double SVMOutput(int index, Instance inst) throws java.lang.Exception
index
- the instance for which output is to be computedinst
- the instance
java.lang.Exception
public java.lang.String toString()
private boolean examineExample(int i2) throws java.lang.Exception
i2
- index of instance to examine
java.lang.Exception
- if something goes wrongprivate boolean takeStep(int i1, int i2, double F2) throws java.lang.Exception
i1
- index of the first instancei2
- index of the second instance
java.lang.Exception
- if something goes wrongprivate void checkClassifier() throws java.lang.Exception
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |