Package elki.distance.correlation
Class AbsolutePearsonCorrelationDistance
- java.lang.Object
-
- elki.distance.AbstractNumberVectorDistance
-
- elki.distance.correlation.AbsolutePearsonCorrelationDistance
-
- All Implemented Interfaces:
Distance<NumberVector>
,NumberVectorDistance<NumberVector>
,PrimitiveDistance<NumberVector>
public class AbsolutePearsonCorrelationDistance extends AbstractNumberVectorDistance
Absolute Pearson correlation distance function for feature vectors. The absolute Pearson correlation distance is computed from the Pearson correlation coefficientr
as:1-abs(r)
. The distance between two vectors will be low (near 0), if their attribute values are dimension-wise strictly positively or negatively correlated, it will be high (near 1), if their attribute values are dimension-wise uncorrelated.- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbsolutePearsonCorrelationDistance.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description static AbsolutePearsonCorrelationDistance
STATIC
Static instance.
-
Constructor Summary
Constructors Constructor Description AbsolutePearsonCorrelationDistance()
Deprecated.Use static instance!
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance(NumberVector v1, NumberVector v2)
Computes the absolute Pearson correlation distance for two given feature vectors.boolean
equals(java.lang.Object obj)
int
hashCode()
java.lang.String
toString()
-
Methods inherited from class elki.distance.AbstractNumberVectorDistance
dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, getInputTypeRestriction
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface elki.distance.Distance
isMetric, isSquared, isSymmetric
-
Methods inherited from interface elki.distance.PrimitiveDistance
instantiate
-
-
-
-
Field Detail
-
STATIC
public static final AbsolutePearsonCorrelationDistance STATIC
Static instance.
-
-
Constructor Detail
-
AbsolutePearsonCorrelationDistance
@Deprecated public AbsolutePearsonCorrelationDistance()
Deprecated.Use static instance!Constructor - useSTATIC
instead.
-
-
Method Detail
-
distance
public double distance(NumberVector v1, NumberVector v2)
Computes the absolute Pearson correlation distance for two given feature vectors. The absolute Pearson correlation distance is computed from the Pearson correlation coefficientr
as:1-abs(r)
. Hence, possible values of this distance are between 0 and 1.- Parameters:
v1
- first feature vectorv2
- second feature vector- Returns:
- the absolute Pearson correlation distance for two given feature vectors v1 and v2
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-