|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.tuwien.ifs.somtoolbox.layers.metrics.AbstractMetric
at.tuwien.ifs.somtoolbox.layers.metrics.MahalanobisMetric
public class MahalanobisMetric
Implements the Mahalanobis distance metric. This metric requires the covariance matrix of the input data to be
pre-calculated and set via the init(double[][])
method prior to calculating distances.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface at.tuwien.ifs.somtoolbox.layers.metrics.DistanceMetric |
---|
DistanceMetric.SparcseMetricModes |
Field Summary | |
---|---|
(package private) double[][] |
covarianceMatrix
|
Fields inherited from class at.tuwien.ifs.somtoolbox.layers.metrics.AbstractMetric |
---|
PACKAGE_NAME |
Constructor Summary | |
---|---|
MahalanobisMetric()
|
Method Summary | |
---|---|
double |
distance(double[] vector1,
double[] vector2)
Calculates the distance between two vectors provided by argument vector1 and vector2 . |
void |
init(double[][] covarianceMatrix)
|
Methods inherited from class at.tuwien.ifs.somtoolbox.layers.metrics.AbstractMetric |
---|
checkDimensions, checkDimensions, compareTo, distance, distance, distance, distance, distance, distance, distance, distance, instantiate, instantiateNice, meanVector, performanceTest, setMetricParams, transformValue, transformVector |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
double[][] covarianceMatrix
Constructor Detail |
---|
public MahalanobisMetric()
Method Detail |
---|
public void init(double[][] covarianceMatrix)
public double distance(double[] vector1, double[] vector2) throws MetricException
DistanceMetric
vector1
and vector2
. A
MetricException
is thrown, if the dimensionalities of the two vectors differ.
distance
in interface DistanceMetric
distance
in class AbstractMetric
vector1
- first vector.vector2
- second vector.
vector1
and vector2
.
MetricException
- if the dimensionalities of the two vectors differ.DistanceMetric.distance(double[], double[])
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |