|
|||||||||
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.USMWavDistance
Class to implement Vitanyi's wonderful Universal Similarity Metric (USM) distance function for wav files! Does exactly what it says on the tin.
Field Summary | |
Instances |
m_CombinedCompressData
Combined compressed wav information data set |
java.lang.String |
m_CombinedCompressFileName
File name and directory of the combined wav information data set |
Instances |
m_SingleCompressData
Single compressed wav information data set |
java.lang.String |
m_SingleCompressFileName
File name and directory of the single wav information data set |
Constructor Summary | |
USMWavDistance(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. |
java.lang.String[] |
getOptions()
Gets the current settings of the USM Wav Distance metric |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(java.lang.String[] args)
Test class for the object! |
void |
reset(Instances data)
Can we put constructor stuff in here? |
double |
returnTheSizeOfCompressedConcatWav(java.lang.String wavFileName1,
java.lang.String wavFileName2)
Returns the compressed concatenated wav file size in bytes |
double |
returnTheSizeOfCompressedWav(java.lang.String wavFileName)
Returns the compressed wav file size in bytes |
void |
setCombinedCompressedData(java.lang.String combinedString)
Set the combined compressed wav file data |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setSingleCompressedData(java.lang.String singleString)
Set the single compressed wav file data |
void |
updateRanges(Instance inst1)
Update the ranges of the distance metric with a new training instance. |
Methods inherited from class classifiers.usm.distance.USMDistanceFunction |
calculateUSM, definePrefix, distance, findAttributesWithPrefix, findInstanceInCache, returnInstanceCache, toString, updateInstanceCache |
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 java.lang.String m_SingleCompressFileName
public Instances m_SingleCompressData
public java.lang.String m_CombinedCompressFileName
public Instances m_CombinedCompressData
Constructor Detail |
public USMWavDistance(Instances data)
data
- the Instance format to be initialisedMethod Detail |
public void reset(Instances data)
reset
in class DistanceMetric
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-e single compressed file name
This makes the user specify the single file name.
-f combined compressed file name
This makes the user specify the combined file name
setOptions
in interface OptionHandler
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic boolean checkInstances(Instances is)
checkInstances
in class USMDistanceFunction
is
- the instances to be checked
public void setSingleCompressedData(java.lang.String singleString)
public void setCombinedCompressedData(java.lang.String combinedString)
public boolean checkInstance(Instance i)
checkInstance
in class USMDistanceFunction
i
- the instance to be checked
public double returnTheSizeOfCompressedWav(java.lang.String wavFileName)
public double returnTheSizeOfCompressedConcatWav(java.lang.String wavFileName1, java.lang.String wavFileName2)
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 void updateRanges(Instance inst1)
updateRanges
in class DistanceMetric
inst1
- the instance to update with
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