Round probability displays to 3 decimal places in tree output #1
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.
Round probability displays to 3 decimal places in tree output
Summary
Implements ticket UBS-2 by rounding probability values to 3 decimal places in tree string representations for improved readability. The change wraps
_compute_posterior_mean()calls withnp.round(decimals=3)in the_str()methods of bothBasePerpendicularTreeandBaseHyperplaneTreeclasses. This only affects classification trees (gated byif not self.is_regression:check) and does not modify any functional logic—only the display output.Files modified:
bayesian_decision_tree/base_perpendicular.py(line 240)bayesian_decision_tree/base_hyperplane.py(line 177)Review & Testing Checklist for Human
examples/demo_classification_perpendicular.py) and verify the printed tree output shows probabilities rounded to 3 decimal placesNotes
numpywas already imported in both files, so no new dependencies were addedis_regressionflagLinear Ticket: UBS-2
Requested by: Shawn Azman (@ShawnAzman)
Link to Devin run: https://app.devin.ai/sessions/73e72f238ea74ef086a6b1e524655b49