|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.Classifier | +--weka.classifiers.DistributionClassifier | +--weka.classifiers.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.
Inner Class Summary | |
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. |
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.util.Enumeration |
listOptions()
Returns an enumeration describing the available options |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
double |
measureNumRules()
Returns the number of rules |
java.lang.String |
printFeatures()
Returns a string description of the features selected |
protected void |
resetOptions()
Resets the options. |
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. |
Methods inherited from class weka.classifiers.DistributionClassifier |
classifyInstance |
Methods inherited from class weka.classifiers.Classifier |
forName, makeCopies |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DecisionTable()
Method Detail |
protected void resetOptions()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setCrossVal(int folds)
folds
- the number of foldspublic int getCrossVal()
public void setMaxStale(int stale)
stale
- the number of nodespublic int getMaxStale()
public void setUseIBk(boolean ibk)
ibk
- true if IBk is to be usedpublic boolean getUseIBk()
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
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 void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class Classifier
data
- set of instances serving as training datajava.lang.Exception
- if the classifier has not been generated successfullypublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in class DistributionClassifier
instance
- the instance to be classifiedjava.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
measureName
- the name of the measure to query for its valuejava.lang.IllegalArgumentException
- if the named measure is not supportedpublic java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] argv)
argv
- the command-line options
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |