|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.distance.similarityfunction.kernel.KernelMatrix
public class KernelMatrix
Provides a class for storing the kernel matrix and several extraction methods for convenience.
Field Summary | |
---|---|
(package private) Matrix |
kernel
The kernel matrix |
Constructor Summary | |
---|---|
KernelMatrix(double[][] matrixArray)
Wraps the matrixArray in a KernelMatrix |
|
KernelMatrix(Matrix matrix)
Makes a new kernel matrix from matrix (with data copying). |
|
KernelMatrix(PrimitiveSimilarityFunction<? super O,DoubleDistance> kernelFunction,
Relation<? extends O> database)
Deprecated. ID mapping is not reliable! |
|
KernelMatrix(PrimitiveSimilarityFunction<? super O,DoubleDistance> kernelFunction,
Relation<? extends O> database,
ArrayDBIDs ids)
Provides a new kernel matrix. |
Method Summary | |
---|---|
static Matrix |
centerKernelMatrix(KernelMatrix kernelMatrix)
Centers the Kernel Matrix in Feature Space according to Smola et. |
static Matrix |
centerMatrix(Matrix matrix)
Centers the matrix in feature space according to Smola et. |
double |
getDistance(int o1,
int o2)
Returns the kernel distance between the two specified objects. |
Matrix |
getKernel()
Get the kernel matrix. |
double |
getSimilarity(int o1,
int o2)
Returns the kernel value of object o1 and object o2 |
double |
getSquaredDistance(int o1,
int o2)
Returns the squared kernel distance between the two specified objects. |
Matrix |
getSubColumn(int i,
List<Integer> ids)
Returns the ith kernel matrix column for all objects in ids |
Matrix |
getSubMatrix(Collection<Integer> ids)
Returns a sub kernel matrix for all objects in ids |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
Matrix kernel
Constructor Detail |
---|
public KernelMatrix(double[][] matrixArray)
matrixArray
- two dimensional double array@Deprecated public KernelMatrix(PrimitiveSimilarityFunction<? super O,DoubleDistance> kernelFunction, Relation<? extends O> database)
kernelFunction
- the kernel function used to compute the kernel matrixdatabase
- the database for which the kernel matrix is computedpublic KernelMatrix(PrimitiveSimilarityFunction<? super O,DoubleDistance> kernelFunction, Relation<? extends O> database, ArrayDBIDs ids)
kernelFunction
- the kernel function used to compute the kernel matrixdatabase
- the database that holds the objectsids
- the IDs of those objects for which the kernel matrix is computedpublic KernelMatrix(Matrix matrix)
matrix
- a matrixMethod Detail |
---|
public double getDistance(int o1, int o2)
o1
- first ObjectIDo2
- second ObjectID
public Matrix getKernel()
public double getSimilarity(int o1, int o2)
o1
- ID of first objecto2
- ID of second object
public double getSquaredDistance(int o1, int o2)
o1
- first ObjectIDo2
- second ObjectID
public Matrix getSubColumn(int i, List<Integer> ids)
i
- the column which should be returnedids
- the objects
public Matrix getSubMatrix(Collection<Integer> ids)
ids
- the objects
public static Matrix centerMatrix(Matrix matrix)
centeredMatrix = centerKernelMatrix(uncenteredMatrix.copy()) {
matrix
- the matrix to be centered
public String toString()
toString
in class Object
public static Matrix centerKernelMatrix(KernelMatrix kernelMatrix)
centeredMatrix = centerKernelMatrix(uncenteredMatrix.copy()) {
kernelMatrix
- the kernel matrix to be centered
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |