EuclideanDistance
, NormalizableDistance
public interface DistanceFunction
Modifier and Type | Method | Description |
---|---|---|
double |
distance(Instance first,
Instance second) |
Calculates the distance between two instances.
|
double |
distance(Instance first,
Instance second,
double cutOffValue) |
Calculates the distance between two instances.
|
java.lang.String |
getAttributeIndices() |
Gets the range of attributes used in the calculation of the distance.
|
Instances |
getInstances() |
returns the instances currently set.
|
boolean |
getInvertSelection() |
Gets whether the matching sense of attribute indices is inverted or not.
|
void |
postProcessDistances(double[] distances) |
Does post processing of the distances (if necessary) returned by
distance(distance(Instance first, Instance second, double cutOffValue).
|
void |
setAttributeIndices(java.lang.String value) |
Sets the range of attributes to use in the calculation of the distance.
|
void |
setInstances(Instances insts) |
Sets the instances.
|
void |
setInvertSelection(boolean value) |
Sets whether the matching sense of attribute indices is inverted or not.
|
void |
update(Instance ins) |
Update the distance function (if necessary) for the newly added instance.
|
void setInstances(Instances insts)
insts
- the instances to useInstances getInstances()
void setAttributeIndices(java.lang.String value)
value
- the new attribute index rangejava.lang.String getAttributeIndices()
void setInvertSelection(boolean value)
value
- if true the matching sense is invertedboolean getInvertSelection()
double distance(Instance first, Instance second)
first
- the first instancesecond
- the second instancedouble distance(Instance first, Instance second, double cutOffValue)
first
- the first instancesecond
- the second instancecutOffValue
- If the distance being calculated becomes larger than
cutOffValue then the rest of the calculation is
discarded.void postProcessDistances(double[] distances)
distances
- the distances to post-processvoid update(Instance ins)
ins
- the instance to addCopyright © 2019 University of Waikato, Hamilton, NZ. All Rights Reserved.