|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pt.tumba.ngram.svm.Kernel
public abstract class Kernel
Abstract interface to model an SVM Kernel.
Field Summary | |
---|---|
private double |
coef0
|
private double |
degree
|
private double |
gamma
|
private int |
kernelType
SVM Kernel type |
private SVMNode[][] |
x
|
private double[] |
xSquare
|
Constructor Summary | |
---|---|
Kernel(int l,
SVMNode[][] x_,
SVMParameter param)
Kernel constructor, prepares to calculate the l*l kernel matrix. |
Method Summary | |
---|---|
(package private) static double |
dot(SVMNode[] x,
SVMNode[] y)
Return the dot product of two vectors. |
(package private) abstract float[] |
getQ(int column,
int len)
Return one column of the Kernel matrix. |
(package private) double |
kernelFunction(int i,
int j)
Returns the value of a single kernel evaluation. |
(package private) static double |
kernelFunction(SVMNode[] x,
SVMNode[] y,
SVMParameter param)
Returns the value of a single kernel evaluation. |
(package private) void |
swapIndex(int i,
int j)
Swap two nodes of the Kernel matrix. |
private static double |
tanh(double x)
Returns the hyperbolic tangent of a given value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private SVMNode[][] x
private final double[] xSquare
private final int kernelType
private final double degree
private final double gamma
private final double coef0
Constructor Detail |
---|
Kernel(int l, SVMNode[][] x_, SVMParameter param)
l
- The length of the kernel matrix (number of rows and columns).x_
- The SVM Nodes.param
- Kernel parameters.Method Detail |
---|
abstract float[] getQ(int column, int len)
column
- The column of the kernel matrix.len
- The nu
void swapIndex(int i, int j)
i
- j
- private static double tanh(double x)
x
- A double value.
static double dot(SVMNode[] x, SVMNode[] y)
x
- A vector.y
- Another vector.
double kernelFunction(int i, int j)
i
- The row of the kernel matrix.j
- The column of the kernel matrix.
static double kernelFunction(SVMNode[] x, SVMNode[] y, SVMParameter param)
x
- The row of the kernel matrix.y
- The column of the kernel matrix.param
- SVM kernel parameters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |