类 OneR
java.lang.Object
weka.classifiers.Classifier
weka.classifiers.rules.OneR
- 所有已实现的接口:
Serializable
,Cloneable
,Sourcable
,CapabilitiesHandler
,OptionHandler
,RevisionHandler
,TechnicalInformationHandler
Class for building and using a 1R classifier; in other words, uses the minimum-error attribute for prediction, discretizing numeric attributes. For more information, see:
R.C. Holte (1993). Very simple classification rules perform well on most commonly used datasets. Machine Learning. 11:63-91. BibTeX:
R.C. Holte (1993). Very simple classification rules perform well on most commonly used datasets. Machine Learning. 11:63-91. BibTeX:
@article{Holte1993, author = {R.C. Holte}, journal = {Machine Learning}, pages = {63-91}, title = {Very simple classification rules perform well on most commonly used datasets}, volume = {11}, year = {1993} }Valid options are:
-B <minimum bucket size> The minimum number of objects in a bucket (default: 6).
- 版本:
- $Revision: 9918 $
- 作者:
- Ian H. Witten (ihw@cs.waikato.ac.nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
buildClassifier
(Instances instances) Generates the classifier.double
classifyInstance
(Instance inst) Classifies a given instance.Returns default capabilities of the classifier.int
Get the value of minBucketSize.String[]
Gets the current settings of the OneR classifier.Returns the revision string.Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.Returns a string describing classifierReturns an enumeration describing the available options..static void
Main method for testing this classReturns the tip text for this propertyweka.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 attributeweka.classifiers.rules.OneR.OneRRule
Create a rule branching on this attribute.void
setMinBucketSize
(int v) Set the value of minBucketSize.void
setOptions
(String[] options) Parses a given list of options.Returns a string that describes the classifier as source.toString()
Returns a description of the classifier从类继承的方法 weka.classifiers.Classifier
debugTipText, distributionForInstance, forName, getDebug, makeCopies, makeCopy, setDebug
-
构造器详细资料
-
OneR
public OneR()
-
-
方法详细资料
-
globalInfo
Returns a string describing classifier- 返回:
- a description suitable for displaying in the explorer/experimenter gui
-
getTechnicalInformation
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- 指定者:
getTechnicalInformation
在接口中TechnicalInformationHandler
- 返回:
- the technical information about this class
-
classifyInstance
Classifies a given instance.- 覆盖:
classifyInstance
在类中Classifier
- 参数:
inst
- the instance to be classified- 返回:
- the classification of the instance
- 抛出:
Exception
- if an error occurred during the prediction
-
getCapabilities
Returns default capabilities of the classifier.- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 覆盖:
getCapabilities
在类中Classifier
- 返回:
- the capabilities of this classifier
- 另请参阅:
-
buildClassifier
Generates the classifier.- 指定者:
buildClassifier
在类中Classifier
- 参数:
instances
- the instances to be used for building the classifier- 抛出:
Exception
- if the classifier can't be built successfully
-
newRule
public weka.classifiers.rules.OneR.OneRRule newRule(Attribute attr, Instances data) throws Exception Create a rule branching on this attribute.- 参数:
attr
- the attribute to branch ondata
- the data to be used for creating the rule- 返回:
- the generated rule
- 抛出:
Exception
- if the rule can't be built successfully
-
newNominalRule
public weka.classifiers.rules.OneR.OneRRule newNominalRule(Attribute attr, Instances data, int[] missingValueCounts) throws Exception Create a rule branching on this nominal attribute.- 参数:
attr
- the attribute to branch ondata
- the data to be used for creating the rulemissingValueCounts
- to be filled in- 返回:
- the generated rule
- 抛出:
Exception
- if the rule can't be built successfully
-
newNumericRule
public weka.classifiers.rules.OneR.OneRRule newNumericRule(Attribute attr, Instances data, int[] missingValueCounts) throws Exception Create a rule branching on this numeric attribute- 参数:
attr
- the attribute to branch ondata
- the data to be used for creating the rulemissingValueCounts
- to be filled in- 返回:
- the generated rule
- 抛出:
Exception
- if the rule can't be built successfully
-
listOptions
Returns an enumeration describing the available options..- 指定者:
listOptions
在接口中OptionHandler
- 覆盖:
listOptions
在类中Classifier
- 返回:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-B <minimum bucket size> The minimum number of objects in a bucket (default: 6).
- 指定者:
setOptions
在接口中OptionHandler
- 覆盖:
setOptions
在类中Classifier
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported
-
getOptions
Gets the current settings of the OneR classifier.- 指定者:
getOptions
在接口中OptionHandler
- 覆盖:
getOptions
在类中Classifier
- 返回:
- an array of strings suitable for passing to setOptions
-
toSource
Returns a string that describes the classifier as source. The classifier will be contained in a class with the given name (there may be auxiliary classes), and will contain a method with the signature:
where the arraypublic static double classify(Object[] i);
i
contains elements that are either Double, String, with missing values represented as null. The generated code is public domain and comes with no warranty. -
toString
Returns a description of the classifier -
minBucketSizeTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getMinBucketSize
public int getMinBucketSize()Get the value of minBucketSize.- 返回:
- Value of minBucketSize.
-
setMinBucketSize
public void setMinBucketSize(int v) Set the value of minBucketSize.- 参数:
v
- Value to assign to minBucketSize.
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中Classifier
- 返回:
- the revision
-
main
Main method for testing this class- 参数:
argv
- the commandline options
-