public class MahalanobisDistanceMeasure extends Object implements DistanceMeasure
Parametered.ParameteredGeneralizations
log
Constructor and Description |
---|
MahalanobisDistanceMeasure() |
Modifier and Type | Method and Description |
---|---|
void |
configure(org.apache.hadoop.conf.Configuration jobConf) |
void |
createParameters(String prefix,
org.apache.hadoop.conf.Configuration jobConf)
EXPERT: consumers should never have to call this method.
|
double |
distance(double centroidLengthSquare,
Vector centroid,
Vector v)
Optimized version of distance metric for sparse vectors.
|
double |
distance(Vector v) |
double |
distance(Vector v1,
Vector v2)
Returns the distance metric applied to the arguments
|
Matrix |
getInverseCovarianceMatrix() |
Vector |
getMeanVector() |
Collection<Parameter<?>> |
getParameters() |
void |
setCovarianceMatrix(Matrix m)
Computes the inverse covariance from the input covariance matrix given in input.
|
void |
setInverseCovarianceMatrix(Matrix inverseCovarianceMatrix) |
void |
setMeanVector(Vector meanVector) |
public void configure(org.apache.hadoop.conf.Configuration jobConf)
configure
in interface Parametered
public Collection<Parameter<?>> getParameters()
getParameters
in interface Parametered
public void createParameters(String prefix, org.apache.hadoop.conf.Configuration jobConf)
Parametered
Parametered.ParameteredGeneralizations
if java supported it. Calling this method should create a new list of
parameters and is calledcreateParameters
in interface Parametered
prefix
- ends with a dot if not empty.jobConf
- configuration used for retrieving valuesinvoking method
,
invoking method
public double distance(Vector v)
v
- The vector to compute the distance topublic double distance(Vector v1, Vector v2)
DistanceMeasure
distance
in interface DistanceMeasure
v1
- a Vector defining a multidimensional point in some feature spacev2
- a Vector defining a multidimensional point in some feature spacepublic double distance(double centroidLengthSquare, Vector centroid, Vector v)
DistanceMeasure
distance
in interface DistanceMeasure
centroidLengthSquare
- Square of the length of centroidcentroid
- Centroid vectorpublic void setInverseCovarianceMatrix(Matrix inverseCovarianceMatrix)
public void setCovarianceMatrix(Matrix m)
m
- A covariance matrix.IllegalArgumentException
- if eigen values equal to 0 found.public Matrix getInverseCovarianceMatrix()
public void setMeanVector(Vector meanVector)
public Vector getMeanVector()
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.