
public class WeightedPearsonCorrelationDistanceFunction extends AbstractVectorDoubleDistanceFunction
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).
This variation is for weighted dimensions.| Modifier and Type | Field and Description |
|---|---|
private double[] |
weights
Weights
|
| Constructor and Description |
|---|
WeightedPearsonCorrelationDistanceFunction(double[] weights)
Provides a PearsonCorrelationDistanceFunction.
|
| Modifier and Type | Method and Description |
|---|---|
double |
doubleDistance(NumberVector<?> v1,
NumberVector<?> v2)
Computes the Pearson correlation distance for two given feature vectors.
|
boolean |
equals(Object obj) |
distance, getDistanceFactory, getInputTypeRestrictioninstantiate, isMetric, isSymmetricclone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinstantiate, isMetric, isSymmetricpublic WeightedPearsonCorrelationDistanceFunction(double[] weights)
weights - Weightspublic double doubleDistance(NumberVector<?> v1, NumberVector<?> v2)
r as: 1-r. Hence, possible values of
this distance are between 0 and 2.v1 - first feature vectorv2 - second feature vector