weka.classifiers.mi
Class TLDSimple

java.lang.Object
  extended by weka.classifiers.Classifier
      extended by weka.classifiers.RandomizableClassifier
          extended by weka.classifiers.mi.TLDSimple
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, CapabilitiesHandler, MultiInstanceCapabilitiesHandler, OptionHandler, Randomizable, RevisionHandler, TechnicalInformationHandler

public class TLDSimple
extends RandomizableClassifier
implements OptionHandler, MultiInstanceCapabilitiesHandler, TechnicalInformationHandler

A simpler version of TLD, mu random but sigma^2 fixed and estimated via data.

For more information see:

Xin Xu (2003). Statistical learning in multiple instance problem. Hamilton, NZ.

BibTeX:

 @mastersthesis{Xu2003,
    address = {Hamilton, NZ},
    author = {Xin Xu},
    note = {0657.594},
    school = {University of Waikato},
    title = {Statistical learning in multiple instance problem},
    year = {2003}
 }
 

Valid options are:

 -C
  Set whether or not use empirical
  log-odds cut-off instead of 0
 -R <numOfRuns>
  Set the number of multiple runs 
  needed for searching the MLE.
 -S <num>
  Random number seed.
  (default 1)
 -D
  If set, classifier is run in debug mode and
  may output additional info to the console

Version:
$Revision: 5527 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz), Xin Xu (xx5@cs.waikato.ac.nz)
See Also:
Serialized Form

Field Summary
static double ZERO
          The very small number representing zero
 
Constructor Summary
TLDSimple()
           
 
Method Summary
 void buildClassifier(Instances exs)
          Generates a classifier.
 double classifyInstance(Instance ex)
          Classifies the given test instance.
 double[] distributionForInstance(Instance ex)
          Computes the distribution for a given exemplar
 Capabilities getCapabilities()
          Returns default capabilities of the classifier.
 Capabilities getMultiInstanceCapabilities()
          Returns the capabilities of this multi-instance classifier for the relational data.
 int getNumRuns()
          Returns the number of runs to perform.
 java.lang.String[] getOptions()
          Gets the current settings of the Classifier.
 java.lang.String getRevision()
          Returns the revision string.
 TechnicalInformation getTechnicalInformation()
          Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.
 boolean getUsingCutOff()
          Returns whether an empirical cutoff is used
 java.lang.String globalInfo()
          Returns a string describing this filter
 java.util.Enumeration listOptions()
          Returns an enumeration describing the available options
static void main(java.lang.String[] args)
          Main method for testing.
 java.lang.String numRunsTipText()
          Returns the tip text for this property
 void setNumRuns(int numRuns)
          Sets the number of runs to perform.
 void setOptions(java.lang.String[] options)
          Parses a given list of options.
 void setUsingCutOff(boolean cutOff)
          Sets whether to use an empirical cutoff.
 java.lang.String toString()
          Gets a string describing the classifier.
 java.lang.String usingCutOffTipText()
          Returns the tip text for this property
 
Methods inherited from class weka.classifiers.RandomizableClassifier
getSeed, seedTipText, setSeed
 
Methods inherited from class weka.classifiers.Classifier
debugTipText, forName, getDebug, makeCopies, makeCopy, setDebug
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static double ZERO
The very small number representing zero

Constructor Detail

TLDSimple

public TLDSimple()
Method Detail

globalInfo

public java.lang.String globalInfo()
Returns a string describing this filter

Returns:
a description of the filter suitable for displaying in the explorer/experimenter gui

getTechnicalInformation

public TechnicalInformation getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.

Specified by:
getTechnicalInformation in interface TechnicalInformationHandler
Returns:
the technical information about this class

getCapabilities

public Capabilities getCapabilities()
Returns default capabilities of the classifier.

Specified by:
getCapabilities in interface CapabilitiesHandler
Overrides:
getCapabilities in class Classifier
Returns:
the capabilities of this classifier
See Also:
Capabilities

getMultiInstanceCapabilities

public Capabilities getMultiInstanceCapabilities()
Returns the capabilities of this multi-instance classifier for the relational data.

Specified by:
getMultiInstanceCapabilities in interface MultiInstanceCapabilitiesHandler
Returns:
the capabilities of this object
See Also:
Capabilities

buildClassifier

public void buildClassifier(Instances exs)
                     throws java.lang.Exception
Description copied from class: Classifier
Generates a classifier. Must initialize all fields of the classifier that are not being set via options (ie. multiple calls of buildClassifier must always lead to the same result). Must not change the dataset in any way.

Specified by:
buildClassifier in class Classifier
Parameters:
exs - the training exemplars
Throws:
java.lang.Exception - if the model cannot be built properly

classifyInstance

public double classifyInstance(Instance ex)
                        throws java.lang.Exception
Description copied from class: Classifier
Classifies the given test instance. The instance has to belong to a dataset when it's being classified. Note that a classifier MUST implement either this or distributionForInstance().

Overrides:
classifyInstance in class Classifier
Parameters:
ex - the given test exemplar
Returns:
the classification
Throws:
java.lang.Exception - if the exemplar could not be classified successfully

distributionForInstance

public double[] distributionForInstance(Instance ex)
                                 throws java.lang.Exception
Computes the distribution for a given exemplar

Overrides:
distributionForInstance in class Classifier
Parameters:
ex - the exemplar for which distribution is computed
Returns:
the distribution
Throws:
java.lang.Exception - if the distribution can't be computed successfully

listOptions

public java.util.Enumeration listOptions()
Returns an enumeration describing the available options

Specified by:
listOptions in interface OptionHandler
Overrides:
listOptions in class RandomizableClassifier
Returns:
an enumeration of all the available options

setOptions

public void setOptions(java.lang.String[] options)
                throws java.lang.Exception
Parses a given list of options.

Valid options are:

 -C
  Set whether or not use empirical
  log-odds cut-off instead of 0
 -R <numOfRuns>
  Set the number of multiple runs 
  needed for searching the MLE.
 -S <num>
  Random number seed.
  (default 1)
 -D
  If set, classifier is run in debug mode and
  may output additional info to the console

Specified by:
setOptions in interface OptionHandler
Overrides:
setOptions in class RandomizableClassifier
Parameters:
options - the list of options as an array of strings
Throws:
java.lang.Exception - if an option is not supported

getOptions

public java.lang.String[] getOptions()
Gets the current settings of the Classifier.

Specified by:
getOptions in interface OptionHandler
Overrides:
getOptions in class RandomizableClassifier
Returns:
an array of strings suitable for passing to setOptions

numRunsTipText

public java.lang.String numRunsTipText()
Returns the tip text for this property

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

setNumRuns

public void setNumRuns(int numRuns)
Sets the number of runs to perform.

Parameters:
numRuns - the number of runs to perform

getNumRuns

public int getNumRuns()
Returns the number of runs to perform.

Returns:
the number of runs to perform

usingCutOffTipText

public java.lang.String usingCutOffTipText()
Returns the tip text for this property

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

setUsingCutOff

public void setUsingCutOff(boolean cutOff)
Sets whether to use an empirical cutoff.

Parameters:
cutOff - whether to use an empirical cutoff

getUsingCutOff

public boolean getUsingCutOff()
Returns whether an empirical cutoff is used

Returns:
true if an empirical cutoff is used

toString

public java.lang.String toString()
Gets a string describing the classifier.

Overrides:
toString in class java.lang.Object
Returns:
a string describing the classifer built.

getRevision

public java.lang.String getRevision()
Returns the revision string.

Specified by:
getRevision in interface RevisionHandler
Overrides:
getRevision in class Classifier
Returns:
the revision

main

public static void main(java.lang.String[] args)
Main method for testing.

Parameters:
args - the options for the classifier