de.lmu.ifi.dbs.elki.distance.distancefunction.correlation
Class PearsonCorrelationDistanceFunction
java.lang.Object
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
de.lmu.ifi.dbs.elki.distance.distancefunction.correlation.PearsonCorrelationDistanceFunction
- All Implemented Interfaces:
- DistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDoubleDistanceFunction<NumberVector<?,?>>, InspectionUtilFrequentlyScanned, Parameterizable
public class PearsonCorrelationDistanceFunction
- extends AbstractVectorDoubleDistanceFunction
Pearson correlation distance function for feature vectors.
The Pearson correlation distance is computed from the Pearson correlation
coefficient r
as: 1-r
. Hence, possible values of
this distance are between 0 and 2.
The distance between two vectors will be low (near 0), if their attribute
values are dimension-wise strictly positively correlated, it will be high
(near 2), if their attribute values are dimension-wise strictly negatively
correlated. For Features with uncorrelated attributes, the distance value
will be intermediate (around 1).
STATIC
public static final PearsonCorrelationDistanceFunction STATIC
- Static instance.
PearsonCorrelationDistanceFunction
@Deprecated
public PearsonCorrelationDistanceFunction()
- Deprecated. Use static instance!
- Provides a PearsonCorrelationDistanceFunction.
doubleDistance
public double doubleDistance(NumberVector<?,?> v1,
NumberVector<?,?> v2)
- Computes the Pearson correlation distance for two given feature vectors.
The Pearson correlation distance is computed from the Pearson correlation
coefficient
r
as: 1-r
. Hence, possible values of
this distance are between 0 and 2.
- Parameters:
v1
- first feature vectorv2
- second feature vector
- Returns:
- the Pearson correlation distance for two given feature vectors v1
and v2
toString
public String toString()
- Overrides:
toString
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object