|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.rules.DecisionTable
Class for building and using a simple decision table majority classifier. For more information see:
Kohavi R. (1995). The Power of Decision Tables. In Proc European Conference on Machine Learning.
Valid options are:
-S num
Number of fully expanded non improving subsets to consider
before terminating a best first search.
(Default = 5)
-X num
Use cross validation to evaluate features. Use number of folds = 1 for
leave one out CV. (Default = leave one out CV)
-I
Use nearest neighbour instead of global table majority.
-R
Prints the decision table.
Nested Class Summary | |
static class |
DecisionTable.hashKey
Class providing keys to the hash table |
class |
DecisionTable.Link
Class for a node in a linked list. |
class |
DecisionTable.LinkedList
Class for handling a linked list. |
Constructor Summary | |
DecisionTable()
Constructor for a DecisionTable |
Method Summary | |
void |
buildClassifier(Instances data)
Generates the classifier. |
java.lang.String |
crossValTipText()
Returns the tip text for this property |
java.lang.String |
displayRulesTipText()
Returns the tip text for this property |
double[] |
distributionForInstance(Instance instance)
Calculates the class membership probabilities for the given test instance. |
java.util.Enumeration |
enumerateMeasures()
Returns an enumeration of the additional measure names |
int |
getCrossVal()
Gets the number of folds for cross validation |
boolean |
getDisplayRules()
Gets whether rules are being printed |
int |
getMaxStale()
Gets the number of non improving decision tables |
double |
getMeasure(java.lang.String additionalMeasureName)
Returns the value of the named measure |
java.lang.String[] |
getOptions()
Gets the current settings of the classifier. |
boolean |
getUseIBk()
Gets whether IBk is being used instead of the majority class |
java.lang.String |
globalInfo()
Returns a string describing 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. |
java.lang.String |
maxStaleTipText()
Returns the tip text for this property |
double |
measureNumRules()
Returns the number of rules |
java.lang.String |
printFeatures()
Returns a string description of the features selected |
void |
setCrossVal(int folds)
Sets the number of folds for cross validation (1 = leave one out) |
void |
setDisplayRules(boolean rules)
Sets whether rules are to be printed |
void |
setMaxStale(int stale)
Sets the number of non improving decision tables to consider before abandoning the search. |
void |
setOptions(java.lang.String[] options)
Parses the options for this object. |
void |
setUseIBk(boolean ibk)
Sets whether IBk should be used instead of the majority class |
java.lang.String |
toString()
Returns a description of the classifier. |
java.lang.String |
useIBkTipText()
Returns the tip text for this property |
Methods inherited from class weka.classifiers.Classifier |
classifyInstance, debugTipText, forName, getDebug, makeCopies, setDebug |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DecisionTable()
Method Detail |
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class Classifier
public java.lang.String crossValTipText()
public void setCrossVal(int folds)
folds
- the number of foldspublic int getCrossVal()
public java.lang.String maxStaleTipText()
public void setMaxStale(int stale)
stale
- the number of nodespublic int getMaxStale()
public java.lang.String useIBkTipText()
public void setUseIBk(boolean ibk)
ibk
- true if IBk is to be usedpublic boolean getUseIBk()
public java.lang.String displayRulesTipText()
public void setDisplayRules(boolean rules)
rules
- true if rules are to be printedpublic boolean getDisplayRules()
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-S num
Number of fully expanded non improving subsets to consider
before terminating a best first search.
(Default = 5)
-X num
Use cross validation to evaluate features. Use number of folds = 1 for
leave one out CV. (Default = leave one out CV)
-I
Use nearest neighbour instead of global table majority.
-R
Prints the decision table.
setOptions
in interface OptionHandler
setOptions
in class Classifier
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class Classifier
public void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class Classifier
data
- set of instances serving as training data
java.lang.Exception
- if the classifier has not been generated successfullypublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in class Classifier
instance
- the instance to be classified
java.lang.Exception
- if distribution can't be computedpublic java.lang.String printFeatures()
public double measureNumRules()
public java.util.Enumeration enumerateMeasures()
enumerateMeasures
in interface AdditionalMeasureProducer
public double getMeasure(java.lang.String additionalMeasureName)
getMeasure
in interface AdditionalMeasureProducer
additionalMeasureName
- the name of the measure to query for its value
java.lang.IllegalArgumentException
- if the named measure is not supportedpublic java.lang.String toString()
public static void main(java.lang.String[] argv)
argv
- the command-line options
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |