Skip to content

Conversation

zhi-bao
Copy link
Contributor

@zhi-bao zhi-bao commented Jul 24, 2025

What does this PR do?

Fix the bug in PR #11.

  • Bug: The last classifier in the rightmost node of tree models was not included in the subtree_weights.
    The original implementation
subtree_weights_end = self.node_ptr[self.root.children[i+1].index] if i+1 < len(self.root.children) else -1 slice = np.s_[:, subtree_weights_start:subtree_weights_end]

causes incorrect slicing for the last subtree, leading to last classifiers in rightmost node(i.e., the last classifier in the last subtree_weights ) being excluded.

  • Solution: Useself.node_ptr[-1] to correctly include the last classifier.

Test CLI & API (bash tests/autotest.sh)

Test APIs used by main.py.

  • Test Pass
    • (Copy and paste the last outputted line here.)
  • Not Applicable (i.e., the PR does not include API changes.)

Check API Document

If any new APIs are added, please check if the description of the APIs is added to API document.

  • API document is updated (linear, nn)
  • Not Applicable (i.e., the PR does not include API changes.)

Test quickstart & API (bash tests/docs/test_changed_document.sh)

If any APIs in quickstarts or tutorials are modified, please run this test to check if the current examples can run correctly after the modified APIs are released.

@zhi-bao zhi-bao requested review from cjlin1 and a team as code owners July 24, 2025 10:33
@zhi-bao zhi-bao added bug Something isn't working model/linear labels Jul 24, 2025
setup.cfg Outdated
[metadata]
name = libmultilabel
version = 0.8.0
version = 0.8.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will release this PR with PR 20, so no need to change this line.

@Eleven1Liu Eleven1Liu self-requested a review July 25, 2025 08:58
Copy link
Contributor

@Eleven1Liu Eleven1Liu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Eleven1Liu Eleven1Liu merged commit 93b605f into ntumlgroup:master Jul 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working model/linear
2 participants