|
|
|||||||||||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||||||||||
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.distance.similarityfunction.kernel.KernelMatrix<O>
O - object typepublic class KernelMatrix<O extends FeatureVector<O,?>>
Provides a class for storing the kernel matrix and several extraction methods for convenience.
| Field Summary | |
|---|---|
(package private) Matrix |
kernel
The kernel matrix |
| Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
|---|
debug, logger |
| Constructor Summary | |
|---|---|
KernelMatrix(double[][] matrixArray)
Wraps the matrixArray in a KernelMatrix |
|
KernelMatrix(KernelFunction<O,DoubleDistance> kernelFunction,
Database<O> database)
Provides a new kernel matrix. |
|
KernelMatrix(KernelFunction<O,DoubleDistance> kernelFunction,
Database<O> database,
List<Integer> ids)
Provides a new kernel matrix. |
|
KernelMatrix(Matrix matrix)
Makes a new kernel matrix from matrix. |
|
| Method Summary | |
|---|---|
static Matrix |
centerKernelMatrix(KernelMatrix<? extends NumberVector<?,?>> 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 de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
|---|
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning |
| 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
public KernelMatrix(KernelFunction<O,DoubleDistance> kernelFunction,
Database<O> database)
kernelFunction - the kernel function used to compute the kernel matrixdatabase - the database for which the kernel matrix is computed
public KernelMatrix(KernelFunction<O,DoubleDistance> kernelFunction,
Database<O> database,
List<Integer> 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 matrix| Method 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 ObjectMatrix.toString()public static Matrix centerKernelMatrix(KernelMatrix<? extends NumberVector<?,?>> 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 | |||||||||||