Repository navigation
TDL: opt-in pruned_leaves extraction (not part of the published TDL) - #674
Merged
Merged
Conversation
… of the published TDL) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.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.
What
Adds an opt-in extraction mode
TDL(hypothesis_extraction="pruned_leaves", prune_tolerance=0.0). It takes thepredicted_leavesexpression and derefines it on the training examples (reduced-error pruning: drop a literal or a whole conjunction while the training F1 stays withinprune_toleranceof the unpruned F1).Important: this is not the published TDL
TDL is a peer-reviewed method. This pruning is not from a peer-reviewed work. It is an Ontolearn addition. That is stated in the module docstring (
ontolearn/learners/tdl_pruning.py), in theHYPOTHESIS_EXTRACTION_MODESdocstring, in the method docstring and in the CHANGELOG. The default (positive_paths) and all existing modes are unchanged.Evidence (issue #672, rerun after #673)
Nested CV, 20 problems (18 of them one synthetic Family KB),
prune_tolerance=0:Tests
tests/test_tdl_pruning.py: unit tests ofprune_rules(never lowers F1 at tolerance 0, never longer, tolerance measured against the unpruned rules, no positives is a no-op) and Family tests (training F1 unchanged, not longer, default unchanged, unknown mode rejected).tests/test_tdl_hypothesis_extraction.py: now iterates over the three published modes only.tests/test_tdl.py,tests/test_tdl_regression.pypass;ruff check ontolearn/learnersis clean.🤖 Generated with Claude Code