Package elki.distance.correlation
Class WeightedSquaredPearsonCorrelationDistance
- java.lang.Object
-
- elki.distance.AbstractNumberVectorDistance
-
- elki.distance.correlation.WeightedSquaredPearsonCorrelationDistance
-
- All Implemented Interfaces:
Distance<NumberVector>,NumberVectorDistance<NumberVector>,PrimitiveDistance<NumberVector>,WeightedNumberVectorDistance<NumberVector>
public class WeightedSquaredPearsonCorrelationDistance extends AbstractNumberVectorDistance implements WeightedNumberVectorDistance<NumberVector>
Weighted squared Pearson correlation distance function for feature vectors.The squared Pearson correlation distance is computed from the Pearson correlation coefficient \(r\) as: \(1-r^2\). Hence, possible values of this distance are between 0 and 1.
The distance between two vectors will be low (near 0), if their attribute values are dimension-wise strictly positively or negatively correlated. For features with uncorrelated attributes, the distance value will be high (near 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 classWeightedSquaredPearsonCorrelationDistance.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 WeightedSquaredPearsonCorrelationDistance(double[] weights)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubledistance(NumberVector v1, NumberVector v2)Computes the distance between two given vectors according to this distance function.booleanequals(java.lang.Object obj)inthashCode()-
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, toString, 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)
Description copied from interface:NumberVectorDistanceComputes the distance between two given vectors according to this distance function.- Specified by:
distancein interfaceNumberVectorDistance<NumberVector>- Specified by:
distancein interfacePrimitiveDistance<NumberVector>- Parameters:
v1- first vectorv2- second vector- Returns:
- the distance between two given vectors according to this distance function
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-