## milk.experiment
Class MIClassifierSplitEvaluator

    java.lang.Object
      |
      +--milk.experiment.MIClassifierSplitEvaluator

All Implemented Interfaces:
  weka.core.AdditionalMeasureProducer, MISplitEvaluator, weka.core.OptionHandler, java.io.Serializable

public class MIClassifierSplitEvaluator
extends java.lang.Object
implements MISplitEvaluator, weka.core.OptionHandler, weka.core.AdditionalMeasureProducer

A SplitEvaluator that produces results for a classification scheme on a nominal class attribute. -W classname
Specify the full class name of the classifier to evaluate.

-C class index
The index of the class for which IR statistics are to be output. (default 1)

See Also:
  Serialized Form

Field Summary
`protected java.lang.String[]` `m_AdditionalMeasures` The names of any additional measures to look for in SplitEvaluators
`protected MIClassifier` `m_Classifier` The classifier used for evaluation
`protected java.lang.String` `m_ClassifierOptions` The classifier options (if any)
`protected java.lang.String` `m_ClassifierVersion` The classifier version
`protected boolean[]` `m_doesProduce` Array of booleans corresponding to the measures in m_AdditionalMeasures indicating which of the AdditionalMeasures the current classifier can produce
`protected int` `m_numberAdditionalMeasures` The number of additional measures that need to be filled in after taking into account column constraints imposed by the final destination for results
`protected java.lang.String` `m_result` Holds the statistics for the most recent application of the classifier

Constructor Summary
`MIClassifierSplitEvaluator()` No args constructor.

Method Summary
`java.lang.String` `classifierTipText()` Returns the tip text for this property
`java.util.Enumeration` `enumerateMeasures()` Returns an enumeration of any additional measure names that might be in the classifier
`int` `getClassForIRStatistics()` Get the value of ClassForIRStatistics.
`MIClassifier` `getClassifier()` Get the value of Classifier.
`java.lang.Object[]` `getKey()` Gets the key describing the current SplitEvaluator.
`java.lang.String[]` `getKeyNames()` Gets the names of each of the key columns produced for a single run.
`java.lang.Object[]` `getKeyTypes()` Gets the data types of each of the key columns produced for a single run.
`double` `getMeasure(java.lang.String additionalMeasureName)` Returns the value of the named measure
`java.lang.String[]` `getOptions()` Gets the current settings of the Classifier.
`java.lang.String` `getRawResultOutput()` Gets the raw output from the classifier
`java.lang.Object[]` `getResult(Exemplars train, Exemplars test)` Gets the results for the supplied train and test datasets.
`java.lang.String[]` `getResultNames()` Gets the names of each of the result columns produced for a single run.
`java.lang.Object[]` `getResultTypes()` Gets the data types of each of the result columns produced for a single run.
`java.lang.String` `globalInfo()` Returns a string describing this split evaluator
`java.util.Enumeration` `listOptions()` Returns an enumeration describing the available options..
`void` `setAdditionalMeasures(java.lang.String[] additionalMeasures)` Set a list of method names for additional measures to look for in Classifiers.
`void` `setClassForIRStatistics(int v)` Set the value of ClassForIRStatistics.
`void` `setClassifier(MIClassifier newClassifier)` Sets the classifier.
`void` `setClassifierName(java.lang.String newClassifierName)` Set the Classifier to use, given it's class name.
`void` `setOptions(java.lang.String[] options)` Parses a given list of options.
`java.lang.String` `toString()` Returns a text description of the split evaluator.
`protected void` `updateOptions()` Updates the options that the current classifier is using.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### m_Classifier

    protected MIClassifier m_Classifier

  The classifier used for evaluation

### m_AdditionalMeasures

    protected java.lang.String[] m_AdditionalMeasures

  The names of any additional measures to look for in SplitEvaluators

### m_doesProduce

    protected boolean[] m_doesProduce

  Array of booleans corresponding to the measures in m_AdditionalMeasures indicating which of the AdditionalMeasures the current classifier can produce

### m_numberAdditionalMeasures

    protected int m_numberAdditionalMeasures

  The number of additional measures that need to be filled in after taking into account column constraints imposed by the final destination for results

### m_result

    protected java.lang.String m_result

  Holds the statistics for the most recent application of the classifier

### m_ClassifierOptions

    protected java.lang.String m_ClassifierOptions

  The classifier options (if any)

### m_ClassifierVersion

    protected java.lang.String m_ClassifierVersion

  The classifier version

Constructor Detail

### MIClassifierSplitEvaluator

    public MIClassifierSplitEvaluator()

  No args constructor.

Method Detail

### globalInfo

    public java.lang.String globalInfo()

  Returns a string describing this split evaluator

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

### 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:

  -W classname
  Specify the full class name of the classifier to evaluate.

  -C class index
  The index of the class for which IR statistics are to be output. (default 1)

  All option after -- will be passed to the classifier.

  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

### setAdditionalMeasures

    public void setAdditionalMeasures(java.lang.String[] additionalMeasures)

  Set a list of method names for additional measures to look for in Classifiers. This could contain many measures (of which only a subset may be produceable by the current Classifier) if an experiment is the type that iterates over a set of properties.

  Specified by:
    `setAdditionalMeasures` in interface `MISplitEvaluator`
  Parameters:
    `additionalMeasures` - a list of method names

### enumerateMeasures

    public java.util.Enumeration enumerateMeasures()

  Returns an enumeration of any additional measure names that might be in the classifier

  Specified by:
    `enumerateMeasures` in interface `weka.core.AdditionalMeasureProducer`
  Returns:
    an enumeration of the measure names

### getMeasure

    public double getMeasure(java.lang.String additionalMeasureName)

  Returns the value of the named measure

  Specified by:
    `getMeasure` in interface `weka.core.AdditionalMeasureProducer`
  Returns:
    the value of the named measure
  Throws:
    `java.lang.IllegalArgumentException` - if the named measure is not supported

### getKeyTypes

    public java.lang.Object[] getKeyTypes()

  Gets the data types of each of the key columns produced for a single run. The number of key fields must be constant for a given SplitEvaluator.

  Specified by:
    `getKeyTypes` in interface `MISplitEvaluator`
  Returns:
    an array containing objects of the type of each key column. The objects should be Strings, or Doubles.

### getKeyNames

    public java.lang.String[] getKeyNames()

  Gets the names of each of the key columns produced for a single run. The number of key fields must be constant for a given SplitEvaluator.

  Specified by:
    `getKeyNames` in interface `MISplitEvaluator`
  Returns:
    an array containing the name of each key column

### getKey

    public java.lang.Object[] getKey()

  Gets the key describing the current SplitEvaluator. For example This may contain the name of the classifier used for classifier predictive evaluation. The number of key fields must be constant for a given SplitEvaluator.

  Specified by:
    `getKey` in interface `MISplitEvaluator`
  Returns:
    an array of objects containing the key.

### getResultTypes

    public java.lang.Object[] getResultTypes()

  Gets the data types of each of the result columns produced for a single run. The number of result fields must be constant for a given SplitEvaluator.

  Specified by:
    `getResultTypes` in interface `MISplitEvaluator`
  Returns:
    an array containing objects of the type of each result column. The objects should be Strings, or Doubles.

### getResultNames

    public java.lang.String[] getResultNames()

  Gets the names of each of the result columns produced for a single run. The number of result fields must be constant for a given SplitEvaluator.

  Specified by:
    `getResultNames` in interface `MISplitEvaluator`
  Returns:
    an array containing the name of each result column

### getResult

    public java.lang.Object[] getResult(Exemplars train,
                                        Exemplars test)
                                 throws java.lang.Exception

  Gets the results for the supplied train and test datasets.

  Specified by:
    `getResult` in interface `MISplitEvaluator`
  Parameters:
    `train` - the training Instances.
    `test` - the testing Instances.
  Returns:
    the results stored in an array. The objects stored in the array may be Strings, Doubles, or null (for the missing value).
  Throws:
    `java.lang.Exception` - if a problem occurs while getting the results

### classifierTipText

    public java.lang.String classifierTipText()

  Returns the tip text for this property

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

### getClassifier

    public MIClassifier getClassifier()

  Get the value of Classifier.

  Returns:
    Value of Classifier.

### setClassifier

    public void setClassifier(MIClassifier newClassifier)

  Sets the classifier.

  Parameters:
    `newClassifier` - the new classifier to use.

### getClassForIRStatistics

    public int getClassForIRStatistics()

  Get the value of ClassForIRStatistics.

  Returns:
    Value of ClassForIRStatistics.

### setClassForIRStatistics

    public void setClassForIRStatistics(int v)

  Set the value of ClassForIRStatistics.

  Parameters:
    `v` - Value to assign to ClassForIRStatistics.

### updateOptions

    protected void updateOptions()

  Updates the options that the current classifier is using.

### setClassifierName

    public void setClassifierName(java.lang.String newClassifierName)
                           throws java.lang.Exception

  Set the Classifier to use, given it's class name. A new classifier will be instantiated.

  Throws:
    `java.lang.Exception` - if the class name is invalid.

### getRawResultOutput

    public java.lang.String getRawResultOutput()

  Gets the raw output from the classifier

  Specified by:
    `getRawResultOutput` in interface `MISplitEvaluator`
  Returns:
    the raw output from the classifier

### toString

    public java.lang.String toString()

  Returns a text description of the split evaluator.

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    a text description of the split evaluator.