public class OneRAttributeEval extends ASEvaluation implements AttributeEvaluator, OptionHandler
-S <seed> Random number seed for cross validation (default = 1)
-F <folds> Number of folds for cross validation (default = 10)
-D Use training data for evaluation rather than cross validaton
-B <minimum bucket size> Minimum number of objects in a bucket (passed on to OneR, default = 6)
Constructor and Description |
---|
OneRAttributeEval()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
buildEvaluator(Instances data)
Initializes a OneRAttribute attribute evaluator.
|
double |
evaluateAttribute(int attribute)
evaluates an individual attribute by measuring the amount
of information gained about the class given the attribute.
|
java.lang.String |
evalUsingTrainingDataTipText()
Returns a string for this option suitable for display in the gui
as a tip text
|
java.lang.String |
foldsTipText()
Returns a string for this option suitable for display in the gui
as a tip text
|
Capabilities |
getCapabilities()
Returns the capabilities of this evaluator.
|
boolean |
getEvalUsingTrainingData()
Returns true if the training data is to be used for evaluation
|
int |
getFolds()
Get the number of folds used for cross validation
|
int |
getMinimumBucketSize()
Get the minimum bucket size used by oneR
|
java.lang.String[] |
getOptions()
returns the current setup.
|
java.lang.String |
getRevision()
Returns the revision string.
|
int |
getSeed()
Get the random number seed
|
java.lang.String |
globalInfo()
Returns a string describing this attribute evaluator
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Main method for testing this class.
|
java.lang.String |
minimumBucketSizeTipText()
Returns a string for this option suitable for display in the gui
as a tip text
|
int[] |
postProcess(int[] attributeSet)
Provides a chance for a attribute evaluator to do any special
post processing of the selected attribute set.
|
java.lang.String |
seedTipText()
Returns a string for this option suitable for display in the gui
as a tip text
|
void |
setEvalUsingTrainingData(boolean e)
Use the training data to evaluate attributes rather than cross validation
|
void |
setFolds(int folds)
Set the number of folds to use for cross validation
|
void |
setMinimumBucketSize(int minB)
Set the minumum bucket size used by OneR
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setSeed(int seed)
Set the random number seed for cross validation
|
java.lang.String |
toString()
Return a description of the evaluator
|
clean, forName, makeCopies
public java.lang.String globalInfo()
public java.lang.String seedTipText()
public void setSeed(int seed)
seed
- the seed to usepublic int getSeed()
int
valuepublic java.lang.String foldsTipText()
public void setFolds(int folds)
folds
- the number of foldspublic int getFolds()
public java.lang.String evalUsingTrainingDataTipText()
public void setEvalUsingTrainingData(boolean e)
e
- true if training data is to be used for evaluationpublic java.lang.String minimumBucketSizeTipText()
public void setMinimumBucketSize(int minB)
minB
- the minimum bucket size to usepublic int getMinimumBucketSize()
public boolean getEvalUsingTrainingData()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-S <seed> Random number seed for cross validation (default = 1)
-F <folds> Number of folds for cross validation (default = 10)
-D Use training data for evaluation rather than cross validaton
-B <minimum bucket size> Minimum number of objects in a bucket (passed on to OneR, default = 6)
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[] 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 evaluateAttribute(int attribute) throws java.lang.Exception
evaluateAttribute
in interface AttributeEvaluator
attribute
- the index of the attribute to be evaluatedjava.lang.Exception
- if the attribute could not 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 int[] postProcess(int[] attributeSet)
ASEvaluation
postProcess
in class ASEvaluation
attributeSet
- the set of attributes found by the searchpublic static void main(java.lang.String[] args)
args
- the options