milk.classifiers
Class DD

java.lang.Object
  |
  +--milk.classifiers.MIClassifier
        |
        +--milk.classifiers.DD
All Implemented Interfaces:
java.lang.Cloneable, weka.core.OptionHandler, java.io.Serializable

public class DD
extends MIClassifier
implements weka.core.OptionHandler

Re-implement the Diverse Density algorithm, changes the testing procedure.

See Also:
Serialized Form

Field Summary
protected  weka.core.Instances m_Attributes
          All attribute names
protected  int[] m_Classes
          Class labels for each bag
protected  int m_ClassIndex
          The index of the class attribute
protected  double[][][] m_Data
          MI data
protected  boolean m_Debug
          Debugging output
protected  int m_IdIndex
           
protected  int m_NumClasses
          The number of the class labels
protected  double[] m_Par
           
 
Constructor Summary
DD()
           
 
Method Summary
 void buildClassifier(Exemplars train)
          Builds the classifier
 double[] distributionForExemplar(Exemplar exmp)
          Computes the distribution for a given exemplar
static double divBy100(double d)
           
 boolean getDebug()
          Gets whether debugging output will be printed.
 java.lang.String[] getOptions()
          Gets the current settings of the classifier.
 java.util.Enumeration listOptions()
          Returns an enumeration describing the available options
static void main(java.lang.String[] argv)
          Main method for testing this class.
 void setDebug(boolean debug)
          Sets whether debugging output will be printed.
 void setOptions(java.lang.String[] options)
          Parses a given list of options.
 java.lang.String toString()
          Gets a string describing the classifier.
 
Methods inherited from class milk.classifiers.MIClassifier
classifyExemplar, forName, makeCopies
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_ClassIndex

protected int m_ClassIndex
The index of the class attribute


m_Par

protected double[] m_Par

m_NumClasses

protected int m_NumClasses
The number of the class labels


m_IdIndex

protected int m_IdIndex

m_Debug

protected boolean m_Debug
Debugging output


m_Classes

protected int[] m_Classes
Class labels for each bag


m_Data

protected double[][][] m_Data
MI data


m_Attributes

protected weka.core.Instances m_Attributes
All attribute names

Constructor Detail

DD

public DD()
Method Detail

listOptions

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

Specified by:
listOptions in interface weka.core.OptionHandler
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:

-D
Turn on debugging output.

-P precision
Set the precision of stopping criteria in Newton method.

-R ridge
Set the ridge parameter for the log-likelihood.

Specified by:
setOptions in interface weka.core.OptionHandler
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 weka.core.OptionHandler
Returns:
an array of strings suitable for passing to setOptions

setDebug

public void setDebug(boolean debug)
Sets whether debugging output will be printed.

Parameters:
debug - true if debugging output should be printed

getDebug

public boolean getDebug()
Gets whether debugging output will be printed.

Returns:
true if debugging output will be printed

buildClassifier

public void buildClassifier(Exemplars train)
                     throws java.lang.Exception
Builds the classifier

Specified by:
buildClassifier in class MIClassifier
Parameters:
train - the training data to be used for generating the boosted classifier.
Throws:
java.lang.Exception - if the classifier could not be built successfully

distributionForExemplar

public double[] distributionForExemplar(Exemplar exmp)
                                 throws java.lang.Exception
Computes the distribution for a given exemplar

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

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.

main

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

Parameters:
argv - should contain the command line arguments to the scheme (see Evaluation)

divBy100

public static double divBy100(double d)