public class ClassifierSubsetEval extends HoldOutSubsetEvaluator implements OptionHandler, ErrorBasedMeritEvaluator
-B <classifier> class name of the classifier to use for accuracy estimation. Place any classifier options LAST on the command line following a "--". eg.: -B weka.classifiers.bayes.NaiveBayes ... -- -K (default: weka.classifiers.rules.ZeroR)
-T Use the training data to estimate accuracy.
-H <filename> Name of the hold out/test set to estimate accuracy on.
Options specific to scheme weka.classifiers.rules.ZeroR:
-D If set, classifier is run in debug mode and may output additional info to the console
Constructor and Description |
---|
ClassifierSubsetEval() |
Modifier and Type | Method and Description |
---|---|
void |
buildEvaluator(Instances data)
Generates a attribute evaluator.
|
java.lang.String |
classifierTipText()
Returns the tip text for this property
|
double |
evaluateSubset(java.util.BitSet subset)
Evaluates a subset of attributes
|
double |
evaluateSubset(java.util.BitSet subset,
Instance holdOut,
boolean retrain)
Evaluates a subset of attributes with respect to a single instance.
|
double |
evaluateSubset(java.util.BitSet subset,
Instances holdOut)
Evaluates a subset of attributes with respect to a set of instances.
|
Capabilities |
getCapabilities()
Returns the capabilities of this evaluator.
|
Classifier |
getClassifier()
Get the classifier used as the base learner.
|
java.io.File |
getHoldOutFile()
Gets the file that holds hold out/test instances.
|
java.lang.String[] |
getOptions()
Gets the current settings of ClassifierSubsetEval
|
java.lang.String |
getRevision()
Returns the revision string.
|
boolean |
getUseTraining()
Get if training data is to be used instead of hold out/test data
|
java.lang.String |
globalInfo()
Returns a string describing this attribute evaluator
|
java.lang.String |
holdOutFileTipText()
Returns the tip text for this property
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Main method for testing this class.
|
void |
setClassifier(Classifier newClassifier)
Set the classifier to use for accuracy estimation
|
void |
setHoldOutFile(java.io.File h)
Set the file that contains hold out/test instances
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setUseTraining(boolean t)
Set if training data is to be used instead of hold out/test data
|
java.lang.String |
toString()
Returns a string describing classifierSubsetEval
|
java.lang.String |
useTrainingTipText()
Returns the tip text for this property
|
clean, forName, makeCopies, postProcess
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-B <classifier> class name of the classifier to use for accuracy estimation. Place any classifier options LAST on the command line following a "--". eg.: -B weka.classifiers.bayes.NaiveBayes ... -- -K (default: weka.classifiers.rules.ZeroR)
-T Use the training data to estimate accuracy.
-H <filename> Name of the hold out/test set to estimate accuracy on.
Options specific to scheme weka.classifiers.rules.ZeroR:
-D If set, classifier is run in debug mode and may output additional info to the console
setOptions
in interface OptionHandler
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String classifierTipText()
public void setClassifier(Classifier newClassifier)
newClassifier
- the Classifier to use.public Classifier getClassifier()
public java.lang.String holdOutFileTipText()
public java.io.File getHoldOutFile()
public void setHoldOutFile(java.io.File h)
h
- the hold out filepublic java.lang.String useTrainingTipText()
public boolean getUseTraining()
public void setUseTraining(boolean t)
t
- true if training data is to be used instead of hold out datapublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class ASEvaluation
Capabilities
public void buildEvaluator(Instances data) throws java.lang.Exception
buildEvaluator
in class ASEvaluation
data
- set of instances serving as training datajava.lang.Exception
- if the evaluator has not been
generated successfullypublic double evaluateSubset(java.util.BitSet subset) throws java.lang.Exception
evaluateSubset
in interface SubsetEvaluator
subset
- a bitset representing the attribute subset to be
evaluatedjava.lang.Exception
- if the subset could not be evaluatedpublic double evaluateSubset(java.util.BitSet subset, Instances holdOut) throws java.lang.Exception
evaluateSubset
in class HoldOutSubsetEvaluator
subset
- a bitset representing the attribute subset to be
evaluatedholdOut
- a set of instances (possibly seperate and distinct
from those use to build/train the evaluator) with which to
evaluate the merit of the subsetjava.lang.Exception
- if the subset cannot be evaluatedpublic double evaluateSubset(java.util.BitSet subset, Instance holdOut, boolean retrain) throws java.lang.Exception
evaluateSubset
in class HoldOutSubsetEvaluator
subset
- a bitset representing the attribute subset to be
evaluatedholdOut
- a single instance (possibly not one of those used to
build/train the evaluator) with which to evaluate the merit of the subsetretrain
- true if the classifier should be retrained with respect
to the new subset before testing on the holdOut instance.java.lang.Exception
- if the subset cannot be evaluatedpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class ASEvaluation
public static void main(java.lang.String[] args)
args
- the options