|
|||||||||
| 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
de.unibi.techfak.jpredictor.clustering.MatrixDistance
public class MatrixDistance
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 |
|---|
| Fields inherited from class de.unibi.techfak.jpredictor.clustering.MatrixSimilarity |
|---|
vrm |
| 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 | |
|---|---|
MatrixDistance(VectorRelationMeasure vrm)
Constructs this class with the relation measure. |
|
| Method Summary | |
|---|---|
double |
atomicCombine(double rel0,
double rel1)
Two relations measures are combined to one result, which is not stored but returned. |
double |
atomicNormalize(double rel,
double norm)
A relations measures is normalized by a certain amount. |
RelationMeasure |
newInstance()
Creates a copy of this relation measure as if it was newly instantiated through a call to the constructor. |
java.lang.String |
toString()
Creates a short string of this relation measure and maybe some results if available. |
(package private) double |
vectorResultsCombine(double resultSoFar,
double nextResult)
Operation to combine a result calculated so far and a next result. |
(package private) double |
vectorResultsInit()
The neutral/initial value for combining the vectorial results. |
| Methods inherited from class de.unibi.techfak.jpredictor.clustering.MatrixSimilarity |
|---|
compute, optimum |
| 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, compareTo, optimum, result |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MatrixDistance(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 |
|---|
double vectorResultsInit()
MatrixSimilarity
vectorResultsInit in class MatrixSimilarity
double vectorResultsCombine(double resultSoFar,
double nextResult)
MatrixSimilarity
vectorResultsCombine in class MatrixSimilarity
public double atomicCombine(double rel0,
double rel1)
RelationMeasureTwo relations measures are combined to one result, which is not stored but returned. This method provides a way to calculate the combined result, when the way how to do this is not known. For instance, distance relation measures normally sum up over single results while likelihood/probabilities are multiplied.
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.
atomicCombine 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 double atomicNormalize(double rel,
double norm)
RelationMeasureA relations measures is normalized by a certain amount. This method provides a way to normalize a relation measure after numbers of them were combined. For instance, distance relation measures normally are normalized by dividing through the count, while likelihoods are rooted.
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.
atomicNormalize in class RelationMeasurerel - The relation measure to be normalized.norm - The normalization value.
Double.NaN in case of error.public RelationMeasure newInstance()
RelationMeasure
newInstance in class RelationMeasurepublic java.lang.String toString()
RelationMeasure
toString in class MatrixSimilarity
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||