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] fix GatherInfoForThresholdNumerical boundary (fix #4286) #4322

Merged
merged 1 commit into from
May 26, 2021

Conversation

shiyu1994
Copy link
Collaborator

This is to fix #4286. In GatherInfoForThresholdNumerical , since it is calculating the right sum statistics, it should break when static_cast<uint32_t>(t + offset) <= threshold instead of static_cast<uint32_t>(t + offset) < threshold. Because data with bin value <= threshold are split into the left child node.

Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

nice, thank you!

@shiyu1994
Copy link
Collaborator Author

BTW, currently our force splits method only produces splits with default_left=true, so only sweeping from the right side of the histogram is implemented in the GatherInfoForThresholdNumerical. Meanwhile, for categorical feature, the split condition can only be a single category value, instead of a set of category values as in normal categorical splits. So I think it requires further efforts to complete the functionality of force splits.

@shiyu1994 shiyu1994 merged commit 346f883 into microsoft:master May 26, 2021
@shiyu1994
Copy link
Collaborator Author

It seems that forced splits functionality is not covered by any test cases. I think we may need to add tests for it.

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Check failed: (best_split_info.left_count) > (0)" in forced_split mode
2 participants