|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.classifiers.AbstractClassifier
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. |
String |
getRevision()
Returns the revision string. |
String |
globalInfo()
Returns a string describing classifier |
static void |
main(String[] argv)
Main method for testing this class. |
String |
toSource(String className)
Returns a string that describes the classifier as source. |
String |
toString()
Returns a description of the classifier. |
| Methods inherited from class weka.classifiers.AbstractClassifier |
|---|
debugTipText, forName, getDebug, getOptions, listOptions, makeCopies, makeCopy, runClassifier, setDebug, setOptions |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ZeroR()
| Method Detail |
|---|
public String globalInfo()
public Capabilities getCapabilities()
getCapabilities in interface ClassifiergetCapabilities in interface CapabilitiesHandlergetCapabilities in class AbstractClassifierCapabilities
public void buildClassifier(Instances instances)
throws Exception
buildClassifier in interface Classifierinstances - set of instances serving as training data
Exception - if the classifier has not been generated successfullypublic double classifyInstance(Instance instance)
classifyInstance in interface ClassifierclassifyInstance in class AbstractClassifierinstance - the instance to be classified
public double[] distributionForInstance(Instance instance)
throws Exception
distributionForInstance in interface ClassifierdistributionForInstance in class AbstractClassifierinstance - the instance to be classified
Exception - if class is numeric
public String toSource(String className)
throws 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 SourcableclassName - the name that should be given to the source class.
Exception - if the souce can't be computedpublic String toString()
toString in class Objectpublic String getRevision()
getRevision in interface RevisionHandlergetRevision in class AbstractClassifierpublic static void main(String[] argv)
argv - the options
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||