Class Knowledge
java.lang.Object
adaa.analytics.rules.logic.representation.Knowledge
- All Implemented Interfaces:
Serializable
Class representing user's knowledge.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanFlag indicating whether automatic induction should be performed for classes for which no user's requirements have been defined (classification problems only) .protected booleanFlag indicating if initial (user's) rules should be extended with automatic conditions/attributes.protected booleanFlag indicating if initial (user's) rules should be extended with preferred conditions/attributes.Maps a class identifier to a list of forbidden attributes (for regression problems, 0 is used as a class id).protected Map<Integer,List<CompoundCondition>> Maps a class identifier to a list of forbidden conditions (for regression problems, 0 is used as a class id).protected booleanFlag indicating if new rules should be induced with automatic conditions.protected booleanFlag indicating if new rules should be induced with preferred conditions and attributes.protected intAuxiliary files indicating number classes (classification problems only).Maps a class identifier to a list of preferred attributes (for regression problems, 0 is used as a class id).protected intMaximum number of preferred attributes per rule.protected Map<Integer,MultiSet<CompoundCondition>> Maps a class identifier to a list of preferred conditions (for regression problems, 0 is used as a class id).protected intMaximum number of preferred conditions per rule.Maps a class identifier to a list of initial rules (for regression problems, 0 is used as a class id). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets element offorbiddenAttributesfor 0th (default) class identifier.getForbiddenAttributes(int classId) Gets element offorbiddenAttributesfor a given class identifier.Gets element offorbiddenConditionsfor 0th (default) class identifier.getForbiddenConditions(int classId) Gets element offorbiddenConditionsfor a given class identifier.Gets element ofpreferredAttributesfor 0th (default) class identifier.getPreferredAttributes(int classId) Gets element ofpreferredAttributesfor a given class identifier.intGets element ofpreferredConditionsfor 0th (default) class identifier.getPreferredConditions(int classId) Gets element ofpreferredConditionsfor a given class identifier.intgetRules()Gets element ofrulesfor 0th (default) class identifier.getRules(int classId) Gets element ofrulesfor a given class identifier.booleanGetsconsiderOtherClasses.booleanGetsextendUsingAutomatic.booleanGetsextendUsingPreferred.booleanisForbidden(String attribute, IValueSet set) Checks if given condition is forbidden by the knowledge (0 is used as a class id).booleanisForbidden(String attribute, IValueSet set, int classId) Checks if given condition is forbidden by the knowledge for specified class.booleanGetsinduceUsingAutomatic.booleanGetsinduceUsingPreferred.voidsetConsiderOtherClasses(boolean considerOtherClasses) SetsconsiderOtherClasses.voidsetExtendUsingAutomatic(boolean extendUsingAutomatic) SetsextendUsingAutomatic.voidsetExtendUsingPreferred(boolean extendUsingPreferred) SetsextendUsingPreferred.voidsetInduceUsingAutomatic(boolean induceUsingAutomatic) SetsinduceUsingAutomatic.voidsetInduceUsingPreferred(boolean induceUsingPreferred) SetsinduceUsingPreferred.voidvoidtoString()Generates text representation of user's knowledge.
-
Field Details
-
extendUsingPreferred
protected boolean extendUsingPreferredFlag indicating if initial (user's) rules should be extended with preferred conditions/attributes. -
extendUsingAutomatic
protected boolean extendUsingAutomaticFlag indicating if initial (user's) rules should be extended with automatic conditions/attributes. -
induceUsingPreferred
protected boolean induceUsingPreferredFlag indicating if new rules should be induced with preferred conditions and attributes. -
induceUsingAutomatic
protected boolean induceUsingAutomaticFlag indicating if new rules should be induced with automatic conditions. -
considerOtherClasses
protected boolean considerOtherClassesFlag indicating whether automatic induction should be performed for classes for which no user's requirements have been defined (classification problems only) . -
preferredConditionsPerRule
protected int preferredConditionsPerRuleMaximum number of preferred conditions per rule. -
preferredAttributesPerRule
protected int preferredAttributesPerRuleMaximum number of preferred attributes per rule. -
numClasses
protected int numClassesAuxiliary files indicating number classes (classification problems only). -
rules
Maps a class identifier to a list of initial rules (for regression problems, 0 is used as a class id). -
preferredConditions
Maps a class identifier to a list of preferred conditions (for regression problems, 0 is used as a class id). -
preferredAttributes
Maps a class identifier to a list of preferred attributes (for regression problems, 0 is used as a class id). -
forbiddenConditions
Maps a class identifier to a list of forbidden conditions (for regression problems, 0 is used as a class id). -
forbiddenAttributes
Maps a class identifier to a list of forbidden attributes (for regression problems, 0 is used as a class id).
-
-
Constructor Details
-
Knowledge
public Knowledge(IExampleSet dataset, MultiSet<Rule> rules, MultiSet<Rule> preferredConditions, MultiSet<Rule> forbiddenConditions) Initializes knowledge from collections of initial rules, preferred/forbidden conditions and attributes.- Parameters:
dataset-rules- Collection of initial rules.preferredConditions- Collection of preferred conditions (it also contains preferred attributes).forbiddenConditions- Collection of forbidden conditions (it also contains forbidden attributes).
-
-
Method Details
-
getRules
Gets element ofrulesfor a given class identifier. -
getPreferredConditions
Gets element ofpreferredConditionsfor a given class identifier. -
getPreferredAttributes
Gets element ofpreferredAttributesfor a given class identifier. -
getForbiddenConditions
Gets element offorbiddenConditionsfor a given class identifier. -
getForbiddenAttributes
Gets element offorbiddenAttributesfor a given class identifier. -
getRules
Gets element ofrulesfor 0th (default) class identifier. -
getPreferredConditions
Gets element ofpreferredConditionsfor 0th (default) class identifier. -
getPreferredAttributes
Gets element ofpreferredAttributesfor 0th (default) class identifier. -
getForbiddenConditions
Gets element offorbiddenConditionsfor 0th (default) class identifier. -
getForbiddenAttributes
Gets element offorbiddenAttributesfor 0th (default) class identifier. -
isExtendUsingPreferred
public boolean isExtendUsingPreferred()GetsextendUsingPreferred. -
setExtendUsingPreferred
public void setExtendUsingPreferred(boolean extendUsingPreferred) SetsextendUsingPreferred. -
isExtendUsingAutomatic
public boolean isExtendUsingAutomatic()GetsextendUsingAutomatic. -
setExtendUsingAutomatic
public void setExtendUsingAutomatic(boolean extendUsingAutomatic) SetsextendUsingAutomatic. -
isInduceUsingPreferred
public boolean isInduceUsingPreferred()GetsinduceUsingPreferred. -
setInduceUsingPreferred
public void setInduceUsingPreferred(boolean induceUsingPreferred) SetsinduceUsingPreferred. -
isInduceUsingAutomatic
public boolean isInduceUsingAutomatic()GetsinduceUsingAutomatic. -
setInduceUsingAutomatic
public void setInduceUsingAutomatic(boolean induceUsingAutomatic) SetsinduceUsingAutomatic. -
isConsiderOtherClasses
public boolean isConsiderOtherClasses()GetsconsiderOtherClasses. -
setConsiderOtherClasses
public void setConsiderOtherClasses(boolean considerOtherClasses) SetsconsiderOtherClasses. -
getPreferredConditionsPerRule
public int getPreferredConditionsPerRule() -
setPreferredConditionsPerRule
public void setPreferredConditionsPerRule(int v) SetspreferredConditionsPerRule. The value of 0 is translated to the infinity. -
getPreferredAttributesPerRule
public int getPreferredAttributesPerRule() -
setPreferredAttributesPerRule
public void setPreferredAttributesPerRule(int v) SetspreferredAttributesPerRule. The value of 0 is translated to the infinity. -
isForbidden
Checks if given condition is forbidden by the knowledge (0 is used as a class id).- Parameters:
attribute- Attribute upon the condition is built.set- Value set in the condition.- Returns:
- Test result.
-
isForbidden
Checks if given condition is forbidden by the knowledge for specified class.- Parameters:
attribute- Attribute upon the condition is built.set- Value set in the condition.classId- Class identifier- Returns:
- Test result.
-
toString
Generates text representation of user's knowledge.
-