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.
|
String |
classifierTipText()
Returns the tip text for this property
|
double |
evaluateSubset(BitSet subset)
Evaluates a subset of attributes
|
double |
evaluateSubset(BitSet subset,
Instance holdOut,
boolean retrain)
Evaluates a subset of attributes with respect to a single instance.
|
double |
evaluateSubset(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.
|
File |
getHoldOutFile()
Gets the file that holds hold out/test instances.
|
String[] |
getOptions()
Gets the current settings of ClassifierSubsetEval
|
String |
getRevision()
Returns the revision string.
|
boolean |
getUseTraining()
Get if training data is to be used instead of hold out/test data
|
String |
globalInfo()
Returns a string describing this attribute evaluator
|
String |
holdOutFileTipText()
Returns the tip text for this property
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] args)
Main method for testing this class.
|
void |
setClassifier(Classifier newClassifier)
Set the classifier to use for accuracy estimation
|
void |
setHoldOutFile(File h)
Set the file that contains hold out/test instances
|
void |
setOptions(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
|
String |
toString()
Returns a string describing classifierSubsetEval
|
String |
useTrainingTipText()
Returns the tip text for this property
|
clean, forName, makeCopies, postProcesspublic String globalInfo()
public Enumeration listOptions()
listOptions in interface OptionHandlerpublic void setOptions(String[] options) throws 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 OptionHandleroptions - the list of options as an array of stringsException - if an option is not supportedpublic String classifierTipText()
public void setClassifier(Classifier newClassifier)
newClassifier - the Classifier to use.public Classifier getClassifier()
public String holdOutFileTipText()
public File getHoldOutFile()
public void setHoldOutFile(File h)
h - the hold out filepublic String useTrainingTipText()
public boolean getUseTraining()
public void setUseTraining(boolean t)
t - true if training data is to be used instead of hold out datapublic String[] getOptions()
getOptions in interface OptionHandlerpublic Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class ASEvaluationCapabilitiespublic void buildEvaluator(Instances data) throws Exception
buildEvaluator in class ASEvaluationdata - set of instances serving as training dataException - if the evaluator has not been
generated successfullypublic double evaluateSubset(BitSet subset) throws Exception
evaluateSubset in interface SubsetEvaluatorsubset - a bitset representing the attribute subset to be
evaluatedException - if the subset could not be evaluatedpublic double evaluateSubset(BitSet subset, Instances holdOut) throws Exception
evaluateSubset in class HoldOutSubsetEvaluatorsubset - 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 subsetException - if the subset cannot be evaluatedpublic double evaluateSubset(BitSet subset, Instance holdOut, boolean retrain) throws Exception
evaluateSubset in class HoldOutSubsetEvaluatorsubset - 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.Exception - if the subset cannot be evaluatedpublic String toString()
public String getRevision()
getRevision in interface RevisionHandlergetRevision in class ASEvaluationpublic static void main(String[] args)
args - the optionsCopyright © 2021 University of Waikato, Hamilton, NZ. All rights reserved.