|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unibi.techfak.jpredictor.clustering.RelationMeasure
public abstract class RelationMeasure
This class is designed to act as a wrapper for any relation between two or more objects. This relation must be expressable as a number, e.g. as a computable result. In this class the result is stored and can be compared to other results.
| Field Summary | |
|---|---|
(package private) double |
computationResult
The result of the computation is stored here. |
| Fields inherited from interface de.unibi.techfak.jpredictor.clustering.Computable |
|---|
COMPUTATION_FAILED, COMPUTATION_PENDING, COMPUTATION_SUCCESS, COMPUTATION_WAITING |
| Constructor Summary | |
|---|---|
RelationMeasure()
|
|
| Method Summary | |
|---|---|
abstract double |
atomicCombine(double rel0,
double rel1)
Two relations measures are combined to one result, which is not stored but returned. |
double |
atomicCombine(java.lang.Object rm)
Two relations measures are combined to one result, which is not stored but returned. |
abstract double |
atomicNormalize(double rel,
double norm)
A relations measures is normalized by a certain amount. |
int |
compareTo(java.lang.Object arg0)
Compares this results to the result of the given object. |
abstract RelationMeasure |
newInstance()
Creates a copy of this relation measure as if it was newly instantiated through a call to the constructor. |
abstract int |
optimum(double rel0,
double rel1)
Compares two relation measure results. |
int |
optimum(java.lang.Object rm)
Compares two result of the given object to the result of this
RelationMeasure. |
double |
result()
After computation is done the result can be obtained through this method. |
abstract java.lang.String |
toString()
Creates a short string of this relation measure and maybe some results if available. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface de.unibi.techfak.jpredictor.clustering.Computable |
|---|
compute |
| Field Detail |
|---|
double computationResult
Double.NaN.
| Constructor Detail |
|---|
public RelationMeasure()
| Method Detail |
|---|
public double result()
compute()-method will be invoked.
Double.NaN
, the computation is not yet finished.public int compareTo(java.lang.Object arg0)
RelationsMeasure or a Number.
Throws a ClassCastException if it is neither. Returns
zero, if both results are Double.NaN. If this result is
Double.NaN, but not the given one, -1 is returned. In
case of the other way round, 1 is returned. Thus, for ordering of
results Double.NaNs are smaller than
Double.NEGATIVE_INFINITY.
compareTo in interface java.lang.Comparablearg0 - The result this one is compared to, which must be either
another RelationsMeasure or a Number.
Comparable.compareTo(java.lang.Object),
Number,
Double.isNaN(double),
Double.isInfinite(double),
Double.NEGATIVE_INFINITYpublic int optimum(java.lang.Object rm)
Compares two result of the given object to the result of this
RelationMeasure. The given result can be either a
RelationMeasure or a Number-value. Returns -1,
zero or 1, if this result is worse, equal, or better than the given
one. The terms worse and better depend on the implementation of this
RelationMeasure. 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, e.g. distances
and likelihoods, since this method works on any RelationMeasure
defined.
rm - The result this one is compared to, which must be either
another RelationsMeasure or a Number.
Number
public abstract int optimum(double rel0,
double rel1)
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.
rel0 - The first relation measure to be compared to the second.rel1 - The second relation measure to be compared to the first.
public double atomicCombine(java.lang.Object rm)
Two 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.
The given result can be either a RelationMeasure or
a Number-value. If this result or the given one
evaluates to Double.NaN not-a-number is returned as
well. Note, that it is possible to mix up relation measures of,
e.g. distances and likelihoods, since this method works on any
RelationMeasure defined.
rm - The result this one is combined with, which must be either
another RelationsMeasure or a Number.
public abstract double atomicCombine(double rel0,
double rel1)
Two 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.
rel0 - The first relation measure to be compared to the second.rel1 - The second relation measure to be compared to the first.
public abstract double atomicNormalize(double rel,
double norm)
A 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.
rel - The relation measure to be normalized.norm - The normalization value.
Double.NaN in case of error.public abstract RelationMeasure newInstance()
public abstract java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||