public abstract class AbstractStringDistanceFunction extends NormalizableDistance
m_ActiveIndices, m_AttributeIndices, m_Data, m_DontNormalize, m_Ranges, m_Validated, R_MAX, R_MIN, R_WIDTH| Constructor and Description |
|---|
AbstractStringDistanceFunction()
Constructor that doesn't set the data
|
AbstractStringDistanceFunction(Instances data)
Constructor that sets the data
|
| Modifier and Type | Method and Description |
|---|---|
protected double |
difference(int index,
String string1,
String string2)
Computes the difference between two given attribute
values.
|
double |
distance(Instance first,
Instance second,
double cutOffValue,
PerformanceStats stats)
Calculates the distance between two instances.
|
protected double |
updateDistance(double currDist,
double diff)
Updates the current distance calculated so far with the new difference
between two attributes.
|
attributeIndicesTipText, difference, distance, distance, distance, dontNormalizeTipText, getAttributeIndices, getDontNormalize, getInstances, getInvertSelection, getOptions, getRanges, globalInfo, initialize, initializeAttributeIndices, initializeRanges, initializeRanges, initializeRanges, initializeRangesEmpty, inRanges, invalidate, invertSelectionTipText, listOptions, norm, postProcessDistances, rangesSet, setAttributeIndices, setDontNormalize, setInstances, setInvertSelection, setOptions, toString, update, updateRanges, updateRanges, updateRanges, updateRangesFirst, validateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetRevisionpublic AbstractStringDistanceFunction()
public AbstractStringDistanceFunction(Instances data)
data - the set of instances that will be used for
later distance comparisonsprotected double updateDistance(double currDist,
double diff)
updateDistance in class NormalizableDistancecurrDist - the current distance calculated so fardiff - the difference between two new attributesNormalizableDistance.difference(int, double, double)protected double difference(int index,
String string1,
String string2)
index - the attribute indexval1 - the first valueval2 - the second valuepublic double distance(Instance first, Instance second, double cutOffValue, PerformanceStats stats)
distance in interface DistanceFunctiondistance in class NormalizableDistancefirst - 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 objectCopyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.