Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX implement additional fix for pruning #350

Merged
merged 3 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(
# Note that the git commit hash cannot be added dynamically here
# That only happens when importing from a git repository.
# See `treeple/__init__.py`
version: '0.10.2',
version: '0.10.3',
license: 'PolyForm Noncommercial 1.0.0',
meson_version: '>= 1.1.0',
default_options: [
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ requires = [

[project]
name = "treeple"
version = "0.10.2"
version = "0.10.3"
description = "Modern decision trees in Python"
maintainers = [
{name = "Neurodata", email = "[email protected]"}
Expand Down
2 changes: 1 addition & 1 deletion treeple/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import sys

__version__ = "0.10.2"
__version__ = "0.10.3"
logger = logging.getLogger(__name__)


Expand Down
7 changes: 6 additions & 1 deletion treeple/tree/honesty/_honest_prune.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,13 @@ cdef _honest_prune(
split_is_degenerate = (
pruner.n_left_samples() == 0 or pruner.n_right_samples() == 0
)
is_leaf_in_origtree = child_l[node_idx] == _TREE_LEAF
# is_leaf_in_origtree = child_l[node_idx] == _TREE_LEAF
# consider whether left or right children node is a leaf node.
is_leaf_in_origtree = (child_l[node_idx] == _TREE_LEAF and child_r[node_idx] == _TREE_LEAF)

if invalid_split or split_is_degenerate or is_leaf_in_origtree:
# invalid_split or is_leaf_in_origtree:
# or split_is_degenerate or is_leaf_in_origtree:
# ... and child_r[node_idx] == _TREE_LEAF:
#
# 1) if node is not degenerate, that means there are still honest-samples in
Expand Down
Loading