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 longprotected static final longprotected static final longprotected int[][]protected static final longprotected static final longprotected static final longprotected int[][]protected IExampleSetFields inherited from class adaa.analytics.rules.logic.induction.ClassificationFinder
precalculatedCoverings, precalculatedCoveringsComplementFields inherited from class adaa.analytics.rules.logic.induction.AbstractFinder
attributeValuesOrder, modifier, params, pool, threadCount -
Constructor Summary
ConstructorsConstructorDescriptionInitializes induction parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddetermineBins(IExampleSet dataset, IAttribute attr, long[] descriptions, int[] mappings, int[] binsBegins, int[] ruleRanges) protected voidexcludeExamplesFromArrays(IExampleSet dataset, IAttribute attr, int binLo, int binHi) protected ElementaryConditioninduceCondition(Rule rule, IExampleSet dataset, Set<Integer> uncoveredPositives, Set<Integer> coveredByRule, Set<IAttribute> allowedAttributes, Pair<String, Object>... extraParams) Induces an elementary condition.protected voidvoidpostprocess(Rule rule, IExampleSet dataset) Postprocesses a rule.voidpreprocess(IExampleSet dataset) If example set is unweighted, method precalculates conditions coverings and stores them as bit vectors in @see precalculatedCoverings field.protected voidvoidprune(Rule rule, IExampleSet dataset, Set<Integer> uncovered) Removes irrelevant conditions from the rule using hill-climbing strategy.protected voidresetArrays(IExampleSet dataset, int targetLabel) protected voidupdateMidpoint(IExampleSet dataset, adaa.analytics.rules.logic.induction.ApproximateClassificationFinder.ConditionCandidate candidate) Methods inherited from class adaa.analytics.rules.logic.induction.ClassificationFinder
checkCandidate, grow, tryAddConditionMethods 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:ClassificationFinderIf example set is unweighted, method precalculates conditions coverings and stores them as bit vectors in @see precalculatedCoverings field.- Overrides:
preprocessin classClassificationFinder- Parameters:
dataset- Training set.
-
prune
Removes irrelevant conditions from the rule using hill-climbing strategy.- Overrides:
prunein 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:
postprocessin 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:
induceConditionin 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:
notifyConditionAddedin 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)
-