public class Rule extends java.lang.Object implements Proposition<Condition>, Measurable, java.io.Serializable
Body and a Head. A rule is meant to cover an example
(given as an AttributeMap), if its body is satisfied. If a rule covers an example all
conditions in its head should be taken into account for making a prediction.
This class implements the method Predicate.test(Object) to check whether a rule covers an
example or not.
| Constructor and Description |
|---|
Rule()
Creates a new conjunctive rule with an empty body and an empty head.
|
Rule(@NotNull Body body)
Creates a new rule with a specific body and an empty head.
|
Rule(@NotNull Body body,
@NotNull Head head)
Creates a new rule with a specific body and head.
|
Rule(@NotNull Head head)
Creates a new conjunctive rule with an empty body and a specific head.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
@NotNull Body |
getBody()
Returns the body of the rule.
|
@NotNull ConfusionMatrix |
getConfusionMatrix()
Returns the confusion matrix that specifies how many true positives, false positives, true
negatives, and false negatives are predicted by the rule.
|
@NotNull Head |
getHead()
Returns the head of the rule.
|
int |
hashCode() |
boolean |
isConjunctive()
Returns, whether the proposition is conjunctive, or not.
|
java.util.Iterator<Condition> |
iterator() |
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAllMatches, getFirstMatch, isDisjunctive, testpublic Rule()
public Rule(@NotNull
@NotNull Body body)
body - The body of the rulepublic Rule(@NotNull
@NotNull Head head)
head - The head of the rule@NotNull public final @NotNull Body getBody()
@NotNull public final @NotNull Head getHead()
@NotNull public @NotNull ConfusionMatrix getConfusionMatrix()
getConfusionMatrix in interface Measurablepublic boolean isConjunctive()
PropositionisConjunctive in interface Proposition<Condition>public java.util.Iterator<Condition> iterator()
iterator in interface java.lang.Iterable<Condition>public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object