de.lmu.ifi.dbs.elki.distance.distancefunction.correlation
Class WeightedSquaredPearsonCorrelationDistanceFunction
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.WeightedSquaredPearsonCorrelationDistanceFunction
- All Implemented Interfaces:
- DistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDoubleDistanceFunction<NumberVector<?,?>>, InspectionUtilFrequentlyScanned, Parameterizable
public class WeightedSquaredPearsonCorrelationDistanceFunction
- extends AbstractVectorDoubleDistanceFunction
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.
Field Summary |
private double[] |
weights
Weights |
weights
private double[] weights
- Weights
WeightedSquaredPearsonCorrelationDistanceFunction
public WeightedSquaredPearsonCorrelationDistanceFunction(double[] weights)
- Provides a SquaredPearsonCorrelationDistanceFunction.
- Parameters:
weights
- Weights
doubleDistance
public double doubleDistance(NumberVector<?,?> v1,
NumberVector<?,?> v2)
- Computes the squared Pearson correlation distance for two given 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.
- Parameters:
v1
- first feature vectorv2
- second feature vector
- Returns:
- the squared Pearson correlation distance for two given feature
vectors v1 and v2
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object