public class MinkowskiDistanceMeasure extends Object implements DistanceMeasure
Parametered.ParameteredGeneralizations
log
Constructor and Description |
---|
MinkowskiDistanceMeasure() |
MinkowskiDistanceMeasure(double exponent) |
Modifier and Type | Method and Description |
---|---|
void |
configure(org.apache.hadoop.conf.Configuration jobConf) |
void |
createParameters(String prefix,
org.apache.hadoop.conf.Configuration conf)
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 v1,
Vector v2)
Math.pow is clever about integer-valued doubles
|
double |
getExponent() |
Collection<Parameter<?>> |
getParameters() |
void |
setExponent(double exponent) |
public MinkowskiDistanceMeasure()
public MinkowskiDistanceMeasure(double exponent)
public void createParameters(String prefix, org.apache.hadoop.conf.Configuration conf)
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.conf
- configuration used for retrieving valuesinvoking method
,
invoking method
public Collection<Parameter<?>> getParameters()
getParameters
in interface Parametered
public void configure(org.apache.hadoop.conf.Configuration jobConf)
configure
in interface Parametered
public double getExponent()
public void setExponent(double exponent)
public double distance(Vector v1, Vector v2)
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 vectorCopyright © 2008–2015 The Apache Software Foundation. All rights reserved.