weka.classifiers.rules
Class Prism.PrismRule

java.lang.Object
  extended byweka.classifiers.rules.Prism.PrismRule
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
Prism

private class Prism.PrismRule
extends java.lang.Object
implements java.io.Serializable

Class for storing a PRISM ruleset, i.e. a list of rules


Field Summary
private  int m_classification
          The classification
private  int m_errors
          Number of errors made by this rule (will end up 0)
private  Instances m_instances
          The instance
private  Prism.PrismRule m_next
          The next rule in the list
private  Prism.Test m_test
          First test of this rule
 
Constructor Summary
Prism.PrismRule(Instances data, int cl)
          Constructor that takes instances and the classification.
 
Method Summary
 Instances coveredBy(Instances data)
          Returns the set of instances that are covered by this rule.
 Instances notCoveredBy(Instances data)
          Returns the set of instances that are not covered by this rule.
 int resultRule(Instance inst)
          Returns the result assigned by this rule to a given instance.
 int resultRules(Instance inst)
          Returns the result assigned by these rules to a given instance.
 java.lang.String toString()
          Prints the set of rules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_classification

private int m_classification
The classification


m_instances

private Instances m_instances
The instance


m_test

private Prism.Test m_test
First test of this rule


m_errors

private int m_errors
Number of errors made by this rule (will end up 0)


m_next

private Prism.PrismRule m_next
The next rule in the list

Constructor Detail

Prism.PrismRule

public Prism.PrismRule(Instances data,
                       int cl)
                throws java.lang.Exception
Constructor that takes instances and the classification.

Parameters:
data - the instances
cl - the class
Throws:
java.lang.Exception - if something goes wrong
Method Detail

resultRule

public int resultRule(Instance inst)
Returns the result assigned by this rule to a given instance.

Parameters:
inst - the instance to be classified
Returns:
the classification

resultRules

public int resultRules(Instance inst)
Returns the result assigned by these rules to a given instance.

Parameters:
inst - the instance to be classified
Returns:
the classification

coveredBy

public Instances coveredBy(Instances data)
Returns the set of instances that are covered by this rule.

Parameters:
data - the instances to be checked
Returns:
the instances covered

notCoveredBy

public Instances notCoveredBy(Instances data)
Returns the set of instances that are not covered by this rule.

Parameters:
data - the instances to be checked
Returns:
the instances not covered

toString

public java.lang.String toString()
Prints the set of rules.

Returns:
a description of the rules as a string