Repository navigation
fix(trxf): weight only rules that fire for the assignment - #214
Open
Hanabi9248 wants to merge 1 commit into
Open
Hanabi9248 wants to merge 1 commit into
Hanabi9248 wants to merge 1 commit into
Conversation
Return the configured default when no weighted rule fires, preserving existing weight initialization guards and label aggregation order. Signed-off-by: Hanabi <317387557+Hanabi9248@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WEIGHTED_SUM and WEIGHTED_MAX currently aggregate every rule without evaluating the input assignment. A trained model can therefore choose an unfired high-weight label, return the same label for mutually exclusive inputs, or fail on an empty rule collection. The constructor describes conflict resolution among fired rules and a default label when nothing matches; the PMML reader maps these modes to the same firing-rule strategies (https://dmg.org/pmml/v4-4/RuleSet.html).
Filter nonfiring conjunctions in both weighted branches and return the configured default for empty/no-hit models. Preserve FIRST_HIT, the existing nonempty first-rule weight initialization assertion, label aggregation order and existing tie behavior. This does not redesign PMML tie handling, change metrics or the Feature parser, or initialize weights automatically.
Validation against master 0ce916f on Python 3.11.16:
Run: python tests/rule_induction/trxf/classifier/test_fired_rule_weighting.py -v
Python 3.10, other Python versions, full installed-package imports, PMML serialization/runtime integration and the full repository suite were not run. This is separate from #211 metrics and #213 arithmetic operand grouping. AI assistance was used in preparing/reviewing the change; reported results are actual local runs.