|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.udo.cs.yale.operator.learner.igss.hypothesis.Hypothesis
edu.udo.cs.yale.operator.learner.igss.hypothesis.Rule
public class Rule
Objects of this class represent a conjunctive rule. All abstract methods of the superclass Hypothesis are implemented.
| Field Summary | |
|---|---|
private static Literal[][] |
allLiterals
All literals possible with the given attributeset. |
private Literal[] |
literals
The premise of the rule. |
private int |
prediction
The index of the label class this rule predicts aka Y+ or Y-. |
| Fields inherited from class edu.udo.cs.yale.operator.learner.igss.hypothesis.Hypothesis |
|---|
coveredWeight, createAllHypothesis, FIRST_TYPE_INDEX, HYPOTHESIS_SPACE_TYPES, LAST_TYPE_INDEX, NEGATIVE_CLASS, POSITIVE_CLASS, positiveWeight, rejectionSampling, TYPE_RULE |
| Constructor Summary | |
|---|---|
Rule(Attribute[] regularAttributes,
Attribute label,
boolean rejectionSampling,
boolean createAll)
Creates a new rule,initializes the regularAttributes and the literals attribute. |
|
Rule(Literal[] literals,
int prediction)
Construct a new rule with the given literals. |
|
Rule(Literal literal,
int prediction)
Construct a new rule with one literal. |
|
| Method Summary | |
|---|---|
boolean |
applicable(Example e)
Test if the rule is applicable to the given examples without updating the corresponding value. |
void |
apply(Example e)
Applies the rule to the given examples. |
boolean |
canBeRefined()
Returns true only if this hypothesis can still be refined. |
Hypothesis |
clone()
Clones the rule with covered and positive weight. |
boolean |
equals(java.lang.Object o)
Returns true if the two rules have the same premise and make the same perdiction. |
int |
getComplexity()
Returns the lenght of the premise of the rule. |
Literal[] |
getLiterals()
Returns the literals in the premise of this rule. |
int |
getPrediction()
Returns the index of prediction of this rule |
java.util.LinkedList<Hypothesis> |
init(int minComplexity)
Creates all rules with length<=minComplexity. <="<" />D> |
java.util.LinkedList<Hypothesis> |
refine()
Creates all successors of the rule that have one more literal. |
java.lang.String |
toString()
Returns a String representation of the rule. |
| Methods inherited from class edu.udo.cs.yale.operator.learner.igss.hypothesis.Hypothesis |
|---|
getCoveredWeight, getLabel, getPositiveWeight, reset, setCoveredWeight, setPositiveWeight |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static Literal[][] allLiterals
private Literal[] literals
private int prediction
| Constructor Detail |
|---|
public Rule(Attribute[] regularAttributes,
Attribute label,
boolean rejectionSampling,
boolean createAll)
public Rule(Literal literal,
int prediction)
public Rule(Literal[] literals,
int prediction)
| Method Detail |
|---|
public Hypothesis clone()
clone in class Hypothesispublic void apply(Example e)
apply in class Hypothesispublic boolean applicable(Example e)
applicable in class Hypothesispublic java.util.LinkedList<Hypothesis> init(int minComplexity)
init in class Hypothesispublic java.util.LinkedList<Hypothesis> refine()
refine in class Hypothesispublic boolean canBeRefined()
canBeRefined in class Hypothesispublic int getPrediction()
getPrediction in class Hypothesispublic int getComplexity()
getComplexity in class Hypothesispublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic Literal[] getLiterals()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||