|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.Classifier | +--weka.classifiers.rules.OneR
Class for building and using a 1R classifier. For more information, see
R.C. Holte (1993). Very simple classification rules perform well on most commonly used datasets. Machine Learning, Vol. 11, pp. 63-91.
Valid options are:
-B num
Specify the minimum number of objects in a bucket (default: 6).
Constructor Summary | |
OneR()
|
Method Summary | |
void |
buildClassifier(Instances instances)
Generates the classifier. |
double |
classifyInstance(Instance inst)
Classifies a given instance. |
int |
getMinBucketSize()
Get the value of minBucketSize. |
java.lang.String[] |
getOptions()
Gets the current settings of the OneR classifier. |
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 |
minBucketSizeTipText()
Returns the tip text for this property |
weka.classifiers.rules.OneR.OneRRule |
newNominalRule(Attribute attr,
Instances data,
int[] missingValueCounts)
Create a rule branching on this nominal attribute. |
weka.classifiers.rules.OneR.OneRRule |
newNumericRule(Attribute attr,
Instances data,
int[] missingValueCounts)
Create a rule branching on this numeric attribute |
weka.classifiers.rules.OneR.OneRRule |
newRule(Attribute attr,
Instances data)
Create a rule branching on this attribute. |
void |
setMinBucketSize(int v)
Set the value of minBucketSize. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
java.lang.String |
toString()
Returns a description of the classifier |
Methods inherited from class weka.classifiers.Classifier |
debugTipText, distributionForInstance, forName, getDebug, makeCopies, setDebug |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public OneR()
Method Detail |
public java.lang.String globalInfo()
public double classifyInstance(Instance inst)
classifyInstance
in class Classifier
inst
- the instance to be classified
public void buildClassifier(Instances instances) throws java.lang.Exception
buildClassifier
in class Classifier
instances
- the instances to be used for building the classifier
java.lang.Exception
- if the classifier can't be built successfullypublic weka.classifiers.rules.OneR.OneRRule newRule(Attribute attr, Instances data) throws java.lang.Exception
attr
- the attribute to branch ondata
- the data to be used for creating the rule
java.lang.Exception
- if the rule can't be built successfullypublic weka.classifiers.rules.OneR.OneRRule newNominalRule(Attribute attr, Instances data, int[] missingValueCounts) throws java.lang.Exception
attr
- the attribute to branch ondata
- the data to be used for creating the rulemissingValueCounts
- to be filled in
java.lang.Exception
- if the rule can't be built successfullypublic weka.classifiers.rules.OneR.OneRRule newNumericRule(Attribute attr, Instances data, int[] missingValueCounts) throws java.lang.Exception
attr
- the attribute to branch ondata
- the data to be used for creating the rulemissingValueCounts
- to be filled in
java.lang.Exception
- if the rule can't be built successfullypublic java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class Classifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-B num
Specify the minimum number of objects in a bucket (default: 6).
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 java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String minBucketSizeTipText()
public int getMinBucketSize()
public void setMinBucketSize(int v)
v
- Value to assign to minBucketSize.public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London