Class ApproximateClassificationFinder
java.lang.Object
adaa.analytics.rules.logic.induction.AbstractFinder
adaa.analytics.rules.logic.induction.ClassificationFinder
adaa.analytics.rules.logic.induction.ApproximateClassificationFinder
- All Implemented Interfaces:
AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int[][]
protected int[][]
protected int[][]
protected int[][]
protected long[][]
protected static final long
protected static final long
protected static final long
protected int[][]
protected static final long
protected static final long
protected static final long
protected int[][]
protected IExampleSet
Fields 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
ConstructorsConstructorDescriptionInitializes induction parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
determineBins
(IExampleSet dataset, IAttribute attr, long[] descriptions, int[] mappings, int[] binsBegins, int[] ruleRanges) protected void
excludeExamplesFromArrays
(IExampleSet dataset, IAttribute attr, int binLo, int binHi) protected ElementaryCondition
induceCondition
(Rule rule, IExampleSet dataset, Set<Integer> uncoveredPositives, Set<Integer> coveredByRule, Set<IAttribute> allowedAttributes, Pair<String, Object>... extraParams) Induces an elementary condition.protected void
void
postprocess
(Rule rule, IExampleSet dataset) Postprocesses a rule.void
preprocess
(IExampleSet dataset) If example set is unweighted, method precalculates conditions coverings and stores them as bit vectors in @see precalculatedCoverings field.protected void
void
prune
(Rule rule, IExampleSet dataset, Set<Integer> uncovered) Removes irrelevant conditions from the rule using hill-climbing strategy.protected void
resetArrays
(IExampleSet dataset, int targetLabel) protected void
updateMidpoint
(IExampleSet dataset, adaa.analytics.rules.logic.induction.ApproximateClassificationFinder.ConditionCandidate candidate) Methods inherited from class adaa.analytics.rules.logic.induction.ClassificationFinder
checkCandidate, grow, tryAddCondition
Methods inherited from class adaa.analytics.rules.logic.induction.AbstractFinder
addObserver, clearObservers, close, names2attributes, notifyConditionRemoved, notifyGrowingFinished, notifyGrowingStarted, notifyRuleReady
-
Field Details
-
MASK_IDENTIFIER
protected static final long MASK_IDENTIFIER- See Also:
-
MASK_BIN
protected static final long MASK_BIN- See Also:
-
OFFSET_BIN
protected static final long OFFSET_BIN- See Also:
-
FLAG_POSITIVE
protected static final long FLAG_POSITIVE- See Also:
-
FLAG_NEW
protected static final long FLAG_NEW- See Also:
-
FLAG_COVERED
protected static final long FLAG_COVERED- See Also:
-
descriptions
protected long[][] descriptions -
mappings
protected int[][] mappings -
bins_positives
protected int[][] bins_positives -
bins_negatives
protected int[][] bins_negatives -
bins_newPositives
protected int[][] bins_newPositives -
bins_begins
protected int[][] bins_begins -
ruleRanges
protected int[][] ruleRanges -
trainSet
-
-
Constructor Details
-
ApproximateClassificationFinder
Initializes induction parameters.- Parameters:
params
- Induction parameters.
-
-
Method Details
-
preprocess
Description copied from class:ClassificationFinder
If example set is unweighted, method precalculates conditions coverings and stores them as bit vectors in @see precalculatedCoverings field.- Overrides:
preprocess
in classClassificationFinder
- Parameters:
dataset
- Training set.
-
prune
Removes irrelevant conditions from the rule using hill-climbing strategy.- Overrides:
prune
in classClassificationFinder
- Parameters:
rule
- Rule to be pruned.dataset
- Training set.uncovered
- Collection of examples yet uncovered by the model (positive examples in the classification problems).
-
postprocess
Postprocesses a rule.- Overrides:
postprocess
in classClassificationFinder
- Parameters:
rule
- Rule to be postprocessed.dataset
- Training set.
-
induceCondition
protected ElementaryCondition induceCondition(Rule rule, IExampleSet dataset, Set<Integer> uncoveredPositives, Set<Integer> coveredByRule, Set<IAttribute> allowedAttributes, Pair<String, Object>... extraParams) Induces an elementary condition.- Overrides:
induceCondition
in classClassificationFinder
- Parameters:
rule
- Current rule.dataset
- Training set.uncoveredPositives
- Set of positive examples uncovered by the model.coveredByRule
- Set of examples covered by the rule being grown.allowedAttributes
- Set of attributes that may be used during induction.extraParams
- Additional parameters.- Returns:
- Induced elementary condition.
-
notifyConditionAdded
- Overrides:
notifyConditionAdded
in classAbstractFinder
-
determineBins
protected void determineBins(IExampleSet dataset, IAttribute attr, long[] descriptions, int[] mappings, int[] binsBegins, int[] ruleRanges) -
excludeExamplesFromArrays
protected void excludeExamplesFromArrays(IExampleSet dataset, IAttribute attr, int binLo, int binHi) -
resetArrays
-
printArrays
protected void printArrays() -
updateMidpoint
protected void updateMidpoint(IExampleSet dataset, adaa.analytics.rules.logic.induction.ApproximateClassificationFinder.ConditionCandidate candidate)
-