You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add check for strictly positive training data for CategoricalHMM #421
Apologies if I missed this but I wasn't able to find in the documentation the CategoricalHMM takes positive values only. I only realized it when I noticed my predictions from fitted models behaving weirdly.
It would be useful to add a warning (or even a transform of the inputs) when fitting the HMM.
Happy to submit a PR if this would be useful.
changed the title [-]Add check for strictly positive values for CategoricalHMM[/-][+]Add check for strictly positive training data for CategoricalHMM[/+]on Jun 3, 2025
I’ve prepared a fix for this issue that validates CategoricalHMM emissions before entering the JAX-transformed fit_em/fit_sgd code. The fix raises a ValueError for out-of-range or non-integer labels rather than silently fitting incorrect data.
I chose an error rather than an automatic 1-based → 0-based transformation because silently recoding the data could hide input mistakes. I’m happy to adjust this to a warning or another behavior if maintainers prefer.
Activity
[-]Add check for strictly positive values for CategoricalHMM[/-][+]Add check for strictly positive training data for CategoricalHMM[/+]PeerAhammad commentedon Oct 3, 2026
I’ve prepared a fix for this issue that validates CategoricalHMM emissions before entering the JAX-transformed
fit_em/fit_sgdcode. The fix raises aValueErrorfor out-of-range or non-integer labels rather than silently fitting incorrect data.I chose an error rather than an automatic 1-based → 0-based transformation because silently recoding the data could hide input mistakes. I’m happy to adjust this to a warning or another behavior if maintainers prefer.
I’ll open a PR with the fix and regression tests.