|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DistanceFunction
Interface for any class that can compute and return distances between two instances.
Method Summary | |
---|---|
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. |
double |
distance(Instance first,
Instance second,
double cutOffValue,
PerformanceStats stats)
Calculates the distance between two instances. |
double |
distance(Instance first,
Instance second,
PerformanceStats stats)
Calculates the distance between two instances. |
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(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. |
Methods inherited from interface weka.core.OptionHandler |
---|
getOptions, listOptions, setOptions |
Method Detail |
---|
void setInstances(Instances insts)
insts
- the instances to useInstances 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(Instance first, Instance second)
first
- the first instancesecond
- the second instance
double distance(Instance first, Instance second, PerformanceStats stats) throws Exception
first
- the first instancesecond
- the second instancestats
- the performance stats object
Exception
- if calculation failsdouble 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.
double distance(Instance first, Instance second, double cutOffValue, PerformanceStats stats)
first
- the first instancesecond
- the second instancecutOffValue
- If the distance being calculated becomes larger than
cutOffValue then the rest of the calculation is
discarded.stats
- the performance stats object
void postProcessDistances(double[] distances)
distances
- the distances to post-processvoid update(Instance ins)
ins
- the instance to add
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |