|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.node.mine.svm.Svm
public class Svm
This class represents a (binary) support vector machine. It works by remembering the support vectors and the corresponding alpha values.
Constructor Summary | |
---|---|
Svm(DoubleVector[] supportVectors,
double[] alpha,
String positive,
double b,
Kernel kernel)
Constructor. |
|
Svm(ModelContentRO predParams,
String id)
Loads a binary SVM from a ModelContent object. |
Method Summary | |
---|---|
double |
distance(DoubleVector vector)
Computes the distance from the hyperplane in the kernel induced hyperspace. |
double[] |
getAlphas()
|
double |
getMargin()
The margin of a SVM is the minimum distance from all support vectors to the decision hyperplane. |
String |
getPositive()
|
DoubleVector[] |
getSupportVectors()
|
double |
getThreshold()
|
double |
predict(DoubleVector vector)
Computes the predicted value of a vector by using the current SVM. |
void |
saveToPredictorParams(ModelContentWO predParams,
String id)
Save the Support Vector Machine for later use. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Svm(DoubleVector[] supportVectors, double[] alpha, String positive, double b, Kernel kernel)
supportVectors
- the support vectors that define the SVMalpha
- the corresponding Lagrange coefficientspositive
- the class for which SVM should yield 1b
- the thresholdkernel
- the kernel to usepublic Svm(ModelContentRO predParams, String id) throws InvalidSettingsException
predParams
- the object to read the SVM configuration from.id
- the unique identifier
InvalidSettingsException
- if the required keys are not presentMethod Detail |
---|
public double distance(DoubleVector vector)
vector
- the vector to predict
public double predict(DoubleVector vector)
vector
- the vector for which to predict the class
public double getMargin()
public void saveToPredictorParams(ModelContentWO predParams, String id)
predParams
- where the SVM will be saved.id
- unique identifier for this SVM.public String toString()
toString
in class Object
public String getPositive()
public DoubleVector[] getSupportVectors()
public double[] getAlphas()
public double getThreshold()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |