|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unibi.techfak.jpredictor.clustering.RelationMeasure
de.unibi.techfak.jpredictor.clustering.MatrixRelationMeasure
de.unibi.techfak.jpredictor.clustering.MatrixSimilarity
public abstract class MatrixSimilarity
Class for calculating the similarity between two matrices. The similarity
is calculated by adding up the similarity between every two matrix arrays.
Different vector similarity measures can be given. This class is used like
this: .
MatrixSimilarity ms = new MatrixSimilarity( new EuclideanDistance() );
ms.add( firstMatrix );
ms.add( secondMatrix );
ms.compute();
// process result (first against second)
ms.add( thirdMatrix );
ms.compute();
// process result (second against third)
...
VectorRelationMeasure,
MinkowskiDistance,
LikelihoodMeasure| Field Summary | |
|---|---|
(package private) VectorRelationMeasure |
vrm
Defines how the single columns of two matrices are to be computed. |
| Fields inherited from class de.unibi.techfak.jpredictor.clustering.MatrixRelationMeasure |
|---|
matrixList |
| Fields inherited from class de.unibi.techfak.jpredictor.clustering.RelationMeasure |
|---|
computationResult |
| Fields inherited from interface de.unibi.techfak.jpredictor.clustering.Computable |
|---|
COMPUTATION_FAILED, COMPUTATION_PENDING, COMPUTATION_SUCCESS, COMPUTATION_WAITING |
| Constructor Summary | |
|---|---|
MatrixSimilarity(VectorRelationMeasure vrm)
Constructs this class with the relation measure. |
|
| Method Summary | |
|---|---|
int |
compute()
Uses all internal informations available and starts and controlls the computational process. |
int |
optimum(double rel0,
double rel1)
Compares two relation measure results. |
java.lang.String |
toString()
Creates a short string of this relation measure and maybe some results if available. |
(package private) abstract double |
vectorResultsCombine(double resultSoFar,
double nextResult)
Operation to combine a result calculated so far and a next result. |
(package private) abstract double |
vectorResultsInit()
The neutral/initial value for combining the vectorial results. |
| Methods inherited from class de.unibi.techfak.jpredictor.clustering.MatrixRelationMeasure |
|---|
add, add, clear, length, lengthRow |
| Methods inherited from class de.unibi.techfak.jpredictor.clustering.RelationMeasure |
|---|
atomicCombine, atomicCombine, atomicNormalize, compareTo, newInstance, optimum, result |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
VectorRelationMeasure vrm
MinkowskiDistance,
ManhattanDistance| Constructor Detail |
|---|
public MatrixSimilarity(VectorRelationMeasure vrm)
throws java.lang.NullPointerException
vrm - The relation measure between two vectors of the matrix.
java.lang.NullPointerException - if vrm is null.| Method Detail |
|---|
public int compute()
Computable
COMPUTATION_SUCCESS.Computable.COMPUTATION_SUCCESS,
Computable.COMPUTATION_FAILEDabstract double vectorResultsInit()
abstract double vectorResultsCombine(double resultSoFar,
double nextResult)
resultSoFar - nextResult -
public int optimum(double rel0,
double rel1)
RelationMeasure
Compares two relation measure results. Returns -1, zero or 1, if the
first (rel0) measure is worse, equal, or better than the
second one (rel1). The terms worse and better depend on
the implementation of the RelationMeasure inheriting
this method. Usually, when dealing with distances, the lower the better.
On the other side, when dealing with likelihoods the higher the better.
Note, that it is possible to mix up optimization of different relation measures, e.g. distances and likelihoods, since this method works on any numbers.
optimum in class RelationMeasurerel0 - The first relation measure to be compared to the second.rel1 - The second relation measure to be compared to the first.
public java.lang.String toString()
RelationMeasure
toString in class RelationMeasure
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||