Skip to content

FIX Make GaussianNB more resilient#7113

Merged
rapids-bot[bot] merged 5 commits intorapidsai:branch-25.10from
betatim:fixup-gaussiannb
Aug 19, 2025
Merged

FIX Make GaussianNB more resilient#7113
rapids-bot[bot] merged 5 commits intorapidsai:branch-25.10from
betatim:fixup-gaussiannb

Conversation

@betatim
Copy link
Copy Markdown
Member

@betatim betatim commented Aug 14, 2025

This makes the minimal changes needed so that GaussianNB does not end up in a broken state where all common checks lead to a MemoryError. The basic fix was to check that X and y have the same number of samples and erroring out (instead of ploughing on).

The sad thing is that to find this fix you had to run all the checks, find the first MemoryError and then run that check with an increasing number of the checks that run before it. Once the memory error raises its head you know that something in the most recently added check must be causing a problem.

towards #7100

Error out when users provide weird inputs instead of getting ourselves
into a broken state.
@betatim betatim requested a review from a team as a code owner August 14, 2025 12:53
@betatim betatim requested review from cjnolet and csadorf August 14, 2025 12:53
@github-actions github-actions Bot added the Cython / Python Cython or Python issue label Aug 14, 2025
Comment thread python/cuml/cuml/naive_bayes/naive_bayes.py Outdated
@betatim betatim added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Aug 18, 2025
@jcrist
Copy link
Copy Markdown
Member

jcrist commented Aug 19, 2025

/merge

@rapids-bot rapids-bot Bot merged commit 78d3e89 into rapidsai:branch-25.10 Aug 19, 2025
71 checks passed
@betatim betatim deleted the fixup-gaussiannb branch August 19, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants