Package elki.distance.correlation
Class WeightedPearsonCorrelationDistance
- java.lang.Object
-
- elki.distance.AbstractNumberVectorDistance
-
- elki.distance.correlation.WeightedPearsonCorrelationDistance
-
- All Implemented Interfaces:
Distance<NumberVector>,NumberVectorDistance<NumberVector>,PrimitiveDistance<NumberVector>,WeightedNumberVectorDistance<NumberVector>
public class WeightedPearsonCorrelationDistance extends AbstractNumberVectorDistance implements WeightedNumberVectorDistance<NumberVector>
Pearson correlation distance function for feature vectors. The Pearson correlation distance is computed from the Pearson correlation coefficientras: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). This variation is for weighted dimensions.- Since:
- 0.4.0
- Author:
- Arthur Zimek, Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWeightedPearsonCorrelationDistance.ParParameterization class.
-
Field Summary
Fields Modifier and Type Field Description private double[]weightsWeights-
Fields inherited from interface elki.distance.WeightedNumberVectorDistance
WEIGHTS_ID
-
-
Constructor Summary
Constructors Constructor Description WeightedPearsonCorrelationDistance(double[] weights)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubledistance(NumberVector v1, NumberVector v2)Computes the Pearson correlation distance for two given feature vectors.booleanequals(java.lang.Object obj)inthashCode()java.lang.StringtoString()-
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
getInputTypeRestriction, instantiate
-
-
-
-
Method Detail
-
distance
public double distance(NumberVector v1, NumberVector v2)
Computes the Pearson correlation distance for two given feature vectors. The Pearson correlation distance is computed from the Pearson correlation coefficientras:1-r. Hence, possible values of this distance are between 0 and 2.- Specified by:
distancein interfaceNumberVectorDistance<NumberVector>- Specified by:
distancein interfacePrimitiveDistance<NumberVector>- Parameters:
v1- first feature vectorv2- second feature vector- Returns:
- the Pearson correlation distance for two given feature vectors v1 and v2
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-