Class ClassificationExpertFinder
java.lang.Object
adaa.analytics.rules.logic.induction.AbstractFinder
adaa.analytics.rules.logic.induction.ClassificationFinder
adaa.analytics.rules.logic.induction.ClassificationExpertFinder
- All Implemented Interfaces:
IExpertFinder
,AutoCloseable
Class for growing and pruning classification rules with user's knowledge.
-
Field Summary
FieldsFields inherited from class adaa.analytics.rules.logic.induction.ClassificationFinder
precalculatedCoverings, precalculatedCoveringsComplement
Fields inherited from class adaa.analytics.rules.logic.induction.AbstractFinder
attributeValuesOrder, modifier, params, pool, threadCount
-
Constructor Summary
ConstructorsConstructorDescriptionClassificationExpertFinder
(InductionParameters params, Knowledge knowledge) Invokes base class constructor and initializes knowledge object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
adjust
(Rule rule, IExampleSet dataset, Set<Integer> uncoveredPositives) Adjusts expert rule.protected boolean
checkCandidate
(ElementaryCondition cnd, double classId, double p, double n, double new_p, double P, double uncoveredSize, int ruleOrderNum) Checks if candidate condition fulfills coverage requirement and is not in conflict with forbidden knowledge.int
grow
(Rule rule, IExampleSet dataset, Set<Integer> uncoveredPositives) Adds elementary conditions to the classification rule premise until termination conditions are fulfilled.void
setKnowledge
(Knowledge knowledge) Sets users knowledge.Methods inherited from class adaa.analytics.rules.logic.induction.ClassificationFinder
induceCondition, postprocess, preprocess, prune, tryAddCondition
Methods inherited from class adaa.analytics.rules.logic.induction.AbstractFinder
addObserver, clearObservers, close, names2attributes, notifyConditionAdded, notifyConditionRemoved, notifyGrowingFinished, notifyGrowingStarted, notifyRuleReady
-
Field Details
-
knowledge
User's knowledge.
-
-
Constructor Details
-
ClassificationExpertFinder
Invokes base class constructor and initializes knowledge object.- Parameters:
params
- Induction parameters.knowledge
- Expert knowledge.
-
-
Method Details
-
setKnowledge
Sets users knowledge.- Parameters:
knowledge
- User's knowledge to be set.
-
adjust
Adjusts expert rule. The procedure specifies value sets of adjustable conditions, i.e., those in the form:- attribute ~= Any,
- attribute ~= SomeSet (non-empty intersection of determined value set with SomeSet is required).
- Specified by:
adjust
in interfaceIExpertFinder
- Parameters:
rule
- Rule to be adjusted.dataset
- Training dataset.uncoveredPositives
- Set of positive examples not covered by the model.
-
grow
Adds elementary conditions to the classification rule premise until termination conditions are fulfilled. The method uses expert knowledge.- Overrides:
grow
in classClassificationFinder
- Parameters:
rule
- Rule to be grown.dataset
- Training set.uncoveredPositives
- Set of positive examples yet uncovered by the model.- Returns:
- Number of conditions added.
-
checkCandidate
protected boolean checkCandidate(ElementaryCondition cnd, double classId, double p, double n, double new_p, double P, double uncoveredSize, int ruleOrderNum) Checks if candidate condition fulfills coverage requirement and is not in conflict with forbidden knowledge.- Overrides:
checkCandidate
in classClassificationFinder
- Parameters:
cnd
- Candidate condition.classId
- Class identifier.- Returns:
-