Package org.biojava.stats.svm
Class DiagonalAddKernel
- java.lang.Object
-
- org.biojava.stats.svm.NestedKernel
-
- org.biojava.stats.svm.DiagonalAddKernel
-
- All Implemented Interfaces:
java.io.Serializable,SVMKernel
public class DiagonalAddKernel extends NestedKernel
Adds a class specific constant to k(x, x).- Author:
- Matthew Pocock
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DiagonalAddKernel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNeg(java.lang.Object o)voidaddPos(java.lang.Object o)doubleevaluate(java.lang.Object a, java.lang.Object b)Return the dot product of a, b.doublegetLambda()Retrieve the scale factor.voidsetLambda(double l)Set the scale factor.java.lang.StringtoString()-
Methods inherited from class org.biojava.stats.svm.NestedKernel
getNestedKernel, setNestedKernel
-
-
-
-
Method Detail
-
addPos
public void addPos(java.lang.Object o)
-
addNeg
public void addNeg(java.lang.Object o)
-
setLambda
public void setLambda(double l)
Set the scale factor.- Parameters:
l- the new scale factor
-
getLambda
public double getLambda()
Retrieve the scale factor.- Returns:
- the current scale factor
-
evaluate
public double evaluate(java.lang.Object a, java.lang.Object b)Return the dot product of a, b.This is equal to
k(a, b) + d(a, b) * ||class(a)|| / (||class||)where d(a, b) is zero if a != b, and 1 if a == b. class(a) is the set of all items in the same class as a. class is all items with a classification.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-