|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.rules.ZeroR
public class ZeroR
Class for building and using a 0-R classifier. Predicts the mean (for a numeric class) or the mode (for a nominal class).
Valid options are:-D If set, classifier is run in debug mode and may output additional info to the console
Constructor Summary | |
---|---|
ZeroR()
|
Method Summary | |
---|---|
void |
buildClassifier(Instances instances)
Generates the classifier. |
double |
classifyInstance(Instance instance)
Classifies a given instance. |
double[] |
distributionForInstance(Instance instance)
Calculates the class membership probabilities for the given test instance. |
Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
java.lang.String |
getRevision()
Returns the revision string. |
java.lang.String |
globalInfo()
Returns a string describing classifier |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
java.lang.String |
toSource(java.lang.String className)
Returns a string that describes the classifier as source. |
java.lang.String |
toString()
Returns a description of the classifier. |
Methods inherited from class weka.classifiers.Classifier |
---|
debugTipText, forName, getDebug, getOptions, listOptions, makeCopies, makeCopy, setDebug, setOptions |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ZeroR()
Method Detail |
---|
public java.lang.String globalInfo()
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Classifier
Capabilities
public void buildClassifier(Instances instances) throws java.lang.Exception
buildClassifier
in class Classifier
instances
- set of instances serving as training data
java.lang.Exception
- if the classifier has not been generated successfullypublic double classifyInstance(Instance instance)
classifyInstance
in class Classifier
instance
- the instance to be classified
public double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in class Classifier
instance
- the instance to be classified
java.lang.Exception
- if class is numericpublic java.lang.String toSource(java.lang.String className) throws java.lang.Exception
public static double classify(Object[] i);
where the array 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.
toSource
in interface Sourcable
className
- the name that should be given to the source class.
java.lang.Exception
- if the souce can't be computedpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
public static void main(java.lang.String[] argv)
argv
- the options
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |