|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.operator.AbstractIOObject
com.rapidminer.operator.ResultObjectAdapter
com.rapidminer.operator.AbstractModel
com.rapidminer.operator.learner.PredictionModel
com.rapidminer.operator.learner.SimplePredictionModel
com.rapidminer.operator.learner.rules.ConjunctiveRuleModel
public class ConjunctiveRuleModel
Each object of this class represents a conjunctive rule with boolean target and nominal attributes. It cannot be changed after construction. This simplifies applications that maintain counts separately. Each attribute may be tested at most once. For two rules it can be tested whether one subsumes the other. A method for refinement allows to create each rule just once. This model may be used to query for the prediction of a single example, as well as to predict complete ExampleSets.
| Constructor Summary | |
|---|---|
ConjunctiveRuleModel(ConjunctiveRuleModel ruleToExtend,
Attribute attribute,
double testValue)
Constructor to create an empty rule that makes a default prediction |
|
ConjunctiveRuleModel(ConjunctiveRuleModel ruleToClone,
int predictedLabel)
Constructor to clone a rule, but to change the head (prediction) |
|
ConjunctiveRuleModel(ExampleSet exampleSet,
int predictedLabel)
Constructor to create an empty rule that makes a default prediction |
|
ConjunctiveRuleModel(ExampleSet exampleSet,
int predictedLabel,
int positives,
int negatives)
Constructor to create an empty rule that makes a default prediction |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object object)
Two rules are equal, if they are both permutations of the same set of literals and predict the same label. |
java.util.Collection<ConjunctiveRuleModel> |
getAllRefinedRules(ExampleSet exampleSet)
A refinement method that - when applied sytematically during learning - generates all rules for nominal attributes and a boolean target exactly once. |
Attribute |
getAttributeOfLiteral(int literalNumber)
|
int |
getConclusion()
|
protected int |
getFirstUnusedAttribute(ExampleSet exampleSet,
Attribute[] allAttributes)
Helper method of getAllRefinedRules. |
int |
getPositionOfAttributeInRule(Attribute attribute)
|
int |
getRuleLength()
|
double |
getTestedValueAtLiteral(int literalNumber)
|
int |
hashCode()
|
boolean |
isRefinementOf(ConjunctiveRuleModel model)
|
double |
predict(Example example)
Applies the model to a single example and returns the predicted class value. |
java.lang.String |
toString()
|
| Methods inherited from class com.rapidminer.operator.learner.SimplePredictionModel |
|---|
performPrediction |
| Methods inherited from class com.rapidminer.operator.learner.PredictionModel |
|---|
apply, checkCompatibility, copyPredictedLabel, createPredictedLabel, getLabel, removePredictedLabel, removePredictedLabel |
| Methods inherited from class com.rapidminer.operator.AbstractModel |
|---|
getExtension, getFileDescription, getName, getResultIcon, getTrainingHeader, isUpdatable, setParameter, updateModel |
| Methods inherited from class com.rapidminer.operator.ResultObjectAdapter |
|---|
addAction, getActions, getVisualizationComponent, isSavable, log, logError, logNote, logWarning, save, toHTML, toResultString |
| Methods inherited from class com.rapidminer.operator.AbstractIOObject |
|---|
copy, getLog, getSource, initWriting, read, setLoggingHandler, setSource, write |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.rapidminer.operator.ResultObject |
|---|
getActions, getVisualizationComponent, toResultString |
| Methods inherited from interface com.rapidminer.operator.IOObject |
|---|
copy, getLog, getSource, setLoggingHandler, setSource, write |
| Methods inherited from interface com.rapidminer.operator.Saveable |
|---|
isSavable, save |
| Constructor Detail |
|---|
public ConjunctiveRuleModel(ExampleSet exampleSet,
int predictedLabel)
exampleSet - the example set used for trainingpredictedLabel - specifies the head of the rule, i.e. which label to predict
public ConjunctiveRuleModel(ExampleSet exampleSet,
int predictedLabel,
int positives,
int negatives)
exampleSet - the example set used for trainingpredictedLabel - specifies the head of the rule, i.e. which label to predict
public ConjunctiveRuleModel(ConjunctiveRuleModel ruleToClone,
int predictedLabel)
public ConjunctiveRuleModel(ConjunctiveRuleModel ruleToExtend,
Attribute attribute,
double testValue)
throws OperatorException
OperatorException| Method Detail |
|---|
public java.lang.String toString()
toString in interface ReadabletoString in class PredictionModelString representation of this rule model.
public double predict(Example example)
throws OperatorException
SimplePredictionModel
predict in class SimplePredictionModelOperatorExceptionpublic int getRuleLength()
public int getConclusion()
public Attribute getAttributeOfLiteral(int literalNumber)
literalNumber - the number of the literal in the rule
public double getTestedValueAtLiteral(int literalNumber)
literalNumber - the number of the literal in the rule
public int getPositionOfAttributeInRule(Attribute attribute)
attribute - to look for in the conjunctive rule
public boolean isRefinementOf(ConjunctiveRuleModel model)
model - another ConjuctiveRuleModel
public boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
protected int getFirstUnusedAttribute(ExampleSet exampleSet,
Attribute[] allAttributes)
getAllRefinedRules. Iterates through the
Attributes of an ExampleSet and compares them to those part of the rule.
exampleSet -
public java.util.Collection<ConjunctiveRuleModel> getAllRefinedRules(ExampleSet exampleSet)
throws OperatorException
exampleSet - used to identify attributes and their values for refinement
OperatorException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||