|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--coreComponents.DistanceMetric | +--classifiers.usm.distance.USMDistanceFunction | +--classifiers.usm.distance.USMStringDistance
Class to implement Vitanyi's wonderful Universal Similarity Metric (USM) distance function for simple strings! Does exactly what it says on the tin.
Constructor Summary | |
USMStringDistance(Instances data)
Simple constructor, just initialise with the data that is being used to check that it is in the correct format! |
Method Summary | |
USMComplexityCache |
calculateComplexityAndComplexityStarOf(Instance x,
Attribute a)
Calculates the first K(x) and second order K(x*) complexities of an object x |
double |
calculateConcatenatedComplexityOf(Instance x,
Instance y,
USMComplexityCache usmcc)
Calculates the first K(xy*) complexity of an object x with a compressed object y* |
boolean |
checkInstance(Instance i)
Function to check that an individual instance is of the correct format. |
boolean |
checkInstances(Instances is)
Function to check that the data instances are in the correct format. |
byte[] |
compressBytes(byte[] input)
Simple function for compressing an array of bytes into another array of bytes! |
static void |
main(java.lang.String[] args)
Test class for the object! |
Methods inherited from class classifiers.usm.distance.USMDistanceFunction |
calculateUSM, definePrefix, distance, findAttributesWithPrefix, findInstanceInCache, returnInstanceCache, toString, updateInstanceCache |
Methods inherited from class coreComponents.DistanceMetric |
forName, reset, updateRanges |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public USMStringDistance(Instances data)
data
- the Instance format to be initialisedMethod Detail |
public boolean checkInstances(Instances is) throws java.lang.Exception
checkInstances
in class USMDistanceFunction
is
- the instances to be checked
java.lang.Exception
public boolean checkInstance(Instance i) throws java.lang.Exception
checkInstance
in class USMDistanceFunction
i
- the instance to be checked
java.lang.Exception
public USMComplexityCache calculateComplexityAndComplexityStarOf(Instance x, Attribute a)
calculateComplexityAndComplexityStarOf
in class USMDistanceFunction
x
- the instance to calculate the complexities for
public double calculateConcatenatedComplexityOf(Instance x, Instance y, USMComplexityCache usmcc)
calculateConcatenatedComplexityOf
in class USMDistanceFunction
x
- the instance to usey
- the instance to use the compression of
public byte[] compressBytes(byte[] input)
input
- byte array to be compressed
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