|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--coreComponents.DistanceMetric | +--classifiers.vdm.ValueDifferenceMetric
Implementation of the Value Difference Metric used in the PEBLS nearest neighbour algorithm detailed in the paper: A Weighted Nearest Neighbor Algorithm for Learning with Symbolic Features 1993, S. Cost and S. Salzberg, John Hopkins University, Baltimore
Field Summary | |
Instances |
m_DistanceTrain
The training set used to generate the VD Matrices |
double |
m_K
The type of Minkowski type distance to use (default K=1 Manhatten) |
ValueDifferenceMetric |
m_TentativeDistanceMetric
|
classifiers.vdm.ValueDifferenceMetric.VDMatrix[] |
m_VDMatrix
The VD Matrices for each attribute |
Constructor Summary | |
ValueDifferenceMetric()
Default constructor |
|
ValueDifferenceMetric(Instances insts)
More complicated constructor |
Method Summary | |
double |
calculateTentativeDistance(Instance inst1,
Instance inst2)
Calculate the tentative instance of the classifier. |
boolean |
checkInstances(Instances insts)
Check if the instances are valid for the distance metric. |
double |
computeValueDifference(int attIndex,
int attValue1,
int attValue2)
|
double |
distance(Instance inst1,
Instance inst2)
Calculates the distance between two instances. |
static void |
main(java.lang.String[] args)
|
void |
reset(Instances insts)
This function is useful if we need to reinitialise the distance metric without using the constructor |
boolean |
setTentativeInstance(Instance inst)
Sets the instances which we tentatively update the distance metric for. |
java.lang.String |
toString()
Creates a debugging string detailing the information about the distance metric |
void |
updateRanges(Instance inst)
Update the ranges of the distance metric with a new training instance. |
Methods inherited from class coreComponents.DistanceMetric |
forName |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public classifiers.vdm.ValueDifferenceMetric.VDMatrix[] m_VDMatrix
public Instances m_DistanceTrain
public double m_K
public ValueDifferenceMetric m_TentativeDistanceMetric
Constructor Detail |
public ValueDifferenceMetric()
public ValueDifferenceMetric(Instances insts)
Method Detail |
public boolean setTentativeInstance(Instance inst)
setTentativeInstance
in interface NonExchangeableDistance
public double calculateTentativeDistance(Instance inst1, Instance inst2)
calculateTentativeDistance
in interface NonExchangeableDistance
public void reset(Instances insts)
reset
in class DistanceMetric
public void updateRanges(Instance inst)
DistanceMetric
updateRanges
in class DistanceMetric
inst
- the instance to update with
public double computeValueDifference(int attIndex, int attValue1, int attValue2)
public double distance(Instance inst1, Instance inst2)
DistanceMetric
distance
in class DistanceMetric
inst1
- the first instanceinst2
- the second instance
public java.lang.String toString()
DistanceMetric
toString
in class DistanceMetric
public boolean checkInstances(Instances insts)
DistanceMetric
checkInstances
in class DistanceMetric
insts
- the training instances to be checked
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London