Skip to content

Fix ruleset metrics for single-class batches - #211

Open
Hanabi9248 wants to merge 1 commit into
Trusted-AI:masterfrom
Hanabi9248:codex/single-class-ruleset-metrics
Open

Fix ruleset metrics for single-class batches#211
Hanabi9248 wants to merge 1 commit into
Trusted-AI:masterfrom
Hanabi9248:codex/single-class-ruleset-metrics

Conversation

@Hanabi9248

@Hanabi9248 Hanabi9248 commented Sep 11, 2026

Copy link
Copy Markdown

compute_ruleset_metrics crashes on a batch where every prediction and label is positive (or every one is negative). Scikit-learn infers a 1x1 confusion matrix, while the function expects four cells.

Pass both boolean labels explicitly so the returned counts keep their binary layout. The regression exercises real rules on four single-class batches; the two correctly classified cases fail before the fix.

On Windows with Python 3.11, python -m unittest discover -s tests/rule_induction/trxf -t . completes successfully: 74 tests run, 1 skipped. This includes the metric, core rule, classifier and PMML export tests. The full ML suite was not run.

Signed-off-by: Hanabi <317387557+Hanabi9248@users.noreply.github.com>
@github-actions
github-actions Bot force-pushed the codex/single-class-ruleset-metrics branch from 62e2ac1 to 4541fba Compare September 11, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant