|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.rules.Prism
Class for building and using a PRISM rule set for classifcation. Can only deal with nominal attributes. Can't deal with missing values. Doesn't do any pruning. For more information, see
J. Cendrowska (1987). PRISM: An algorithm for inducing modular rules. International Journal of Man-Machine Studies. Vol.27, No.4, pp.349-370.
Nested Class Summary | |
private class |
Prism.PrismRule
Class for storing a PRISM ruleset, i.e. a list of rules |
private class |
Prism.Test
Class for storing a list of attribute-value tests |
Field Summary | |
private Prism.PrismRule |
m_rules
The first rule in the list of rules |
Fields inherited from class weka.classifiers.Classifier |
m_Debug |
Constructor Summary | |
Prism()
|
Method Summary | |
private Prism.PrismRule |
addRule(Prism.PrismRule lastRule,
Prism.PrismRule newRule)
Add a rule to the ruleset. |
private Prism.Test |
addTest(Prism.PrismRule rule,
Prism.Test lastTest,
Prism.Test newTest)
Add a test to this rule. |
void |
buildClassifier(Instances data)
Generates the classifier. |
double |
classifyInstance(Instance inst)
Classifies a given instance. |
private static boolean |
contains(Instances E,
int C)
Does E contain any examples in the class C? |
java.lang.String |
globalInfo()
Returns a string describing classifier |
private static boolean |
isMentionedIn(Attribute attr,
Prism.Test t)
Is this attribute mentioned in the rule? |
static void |
main(java.lang.String[] args)
Main method for testing this class |
java.lang.String |
toString()
Prints a description of the classifier. |
Methods inherited from class weka.classifiers.Classifier |
debugTipText, distributionForInstance, forName, getDebug, getOptions, listOptions, makeCopies, setDebug, setOptions |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private Prism.PrismRule m_rules
Constructor Detail |
public Prism()
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 data) throws java.lang.Exception
buildClassifier
in class Classifier
data
- the data to be used
java.lang.Exception
- if the classifier can't built successfullyprivate Prism.PrismRule addRule(Prism.PrismRule lastRule, Prism.PrismRule newRule)
lastRule
- the last rule in the rule setnewRule
- the rule to be added
private Prism.Test addTest(Prism.PrismRule rule, Prism.Test lastTest, Prism.Test newTest)
rule
- the rule to which test is to be addedlastTest
- the rule's last testnewTest
- the test to be added
private static boolean contains(Instances E, int C) throws java.lang.Exception
E
- the instances to be checkedC
- the class
java.lang.Exception
private static boolean isMentionedIn(Attribute attr, Prism.Test t)
attr
- the attribute to be checked fort
- test contained by rulepublic java.lang.String toString()
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |