public interface DistanceFunction
Modifier and Type | Method and Description |
---|---|
double |
distance(weka.core.Instance first,
weka.core.Instance second)
Calculates the distance between two instances.
|
double |
distance(weka.core.Instance first,
weka.core.Instance second,
double cutOffValue)
Calculates the distance between two instances.
|
String |
getAttributeIndices()
Gets the range of attributes used in the calculation of the distance.
|
weka.core.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(String value)
Sets the range of attributes to use in the calculation of the distance.
|
void |
setInstances(weka.core.Instances insts)
Sets the instances.
|
void |
setInvertSelection(boolean value)
Sets whether the matching sense of attribute indices is inverted or not.
|
void |
update(weka.core.Instance ins)
Update the distance function (if necessary) for the newly added instance.
|
void setInstances(weka.core.Instances insts)
insts
- the instances to useweka.core.Instances getInstances()
void setAttributeIndices(String value)
value
- the new attribute index rangeString getAttributeIndices()
void setInvertSelection(boolean value)
value
- if true the matching sense is invertedboolean getInvertSelection()
double distance(weka.core.Instance first, weka.core.Instance second)
first
- the first instancesecond
- the second instancedouble distance(weka.core.Instance first, weka.core.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(weka.core.Instance ins)
ins
- the instance to addCopyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.