-
-
Notifications
You must be signed in to change notification settings - Fork 26.2k
FIX Bisecting kmeans when data has 1 feature #27243
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me. The thing I don't understand is why this only happens if n_features=1
. Wouldn't it happen always when n_features != 2
?
When n_features > 2 we allocate an array to big but since we only access the first 2 elements later there's no out of bound issue |
Co-authored-by: Tim Head <betatim@gmail.com>
Ah yes. So there is a bug for |
I wouldn't call it a bug but a sub-optimal memory management 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Is predict
also affected?
Nope |
Co-authored-by: Tim Head <betatim@gmail.com>
Co-authored-by: Tim Head <betatim@gmail.com>
Co-authored-by: Tim Head <betatim@gmail.com>
Co-authored-by: Tim Head <betatim@gmail.com>
Fixes #27236