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 boolean
Flag indicating whether automatic induction should be performed for classes for which no user's requirements have been defined (classification problems only) .protected boolean
Flag indicating if initial (user's) rules should be extended with automatic conditions/attributes.protected boolean
Flag 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 boolean
Flag indicating if new rules should be induced with automatic conditions.protected boolean
Flag indicating if new rules should be induced with preferred conditions and attributes.protected int
Auxiliary 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 int
Maximum 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 int
Maximum 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 offorbiddenAttributes
for 0th (default) class identifier.getForbiddenAttributes
(int classId) Gets element offorbiddenAttributes
for a given class identifier.Gets element offorbiddenConditions
for 0th (default) class identifier.getForbiddenConditions
(int classId) Gets element offorbiddenConditions
for a given class identifier.Gets element ofpreferredAttributes
for 0th (default) class identifier.getPreferredAttributes
(int classId) Gets element ofpreferredAttributes
for a given class identifier.int
Gets element ofpreferredConditions
for 0th (default) class identifier.getPreferredConditions
(int classId) Gets element ofpreferredConditions
for a given class identifier.int
getRules()
Gets element ofrules
for 0th (default) class identifier.getRules
(int classId) Gets element ofrules
for a given class identifier.boolean
GetsconsiderOtherClasses
.boolean
GetsextendUsingAutomatic
.boolean
GetsextendUsingPreferred
.boolean
isForbidden
(String attribute, IValueSet set) Checks if given condition is forbidden by the knowledge (0 is used as a class id).boolean
isForbidden
(String attribute, IValueSet set, int classId) Checks if given condition is forbidden by the knowledge for specified class.boolean
GetsinduceUsingAutomatic
.boolean
GetsinduceUsingPreferred
.void
setConsiderOtherClasses
(boolean considerOtherClasses) SetsconsiderOtherClasses
.void
setExtendUsingAutomatic
(boolean extendUsingAutomatic) SetsextendUsingAutomatic
.void
setExtendUsingPreferred
(boolean extendUsingPreferred) SetsextendUsingPreferred
.void
setInduceUsingAutomatic
(boolean induceUsingAutomatic) SetsinduceUsingAutomatic
.void
setInduceUsingPreferred
(boolean induceUsingPreferred) SetsinduceUsingPreferred
.void
void
toString()
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 ofrules
for a given class identifier. -
getPreferredConditions
Gets element ofpreferredConditions
for a given class identifier. -
getPreferredAttributes
Gets element ofpreferredAttributes
for a given class identifier. -
getForbiddenConditions
Gets element offorbiddenConditions
for a given class identifier. -
getForbiddenAttributes
Gets element offorbiddenAttributes
for a given class identifier. -
getRules
Gets element ofrules
for 0th (default) class identifier. -
getPreferredConditions
Gets element ofpreferredConditions
for 0th (default) class identifier. -
getPreferredAttributes
Gets element ofpreferredAttributes
for 0th (default) class identifier. -
getForbiddenConditions
Gets element offorbiddenConditions
for 0th (default) class identifier. -
getForbiddenAttributes
Gets element offorbiddenAttributes
for 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.
-