Skip to content

Fix nan creation#37

Merged
remlapmot merged 6 commits intomainfrom
fix-nan-creation
Mar 19, 2026
Merged

Fix nan creation#37
remlapmot merged 6 commits intomainfrom
fix-nan-creation

Conversation

@ryan-odea
Copy link
Copy Markdown
Collaborator

I have potentially found what was causing some Nan proliferation in your data (and any other data).
The category casting was forcing everything to be strings, which then would be coerced back to mismatched types. I've also added the fixed casting to all of the prediction tools.

I decided to change the probability warning to valueError - let me know how you feel about this. I think the strict error is maybe more useful than a probability which converges quickly at $1 - 0.5^t$

@ryan-odea ryan-odea requested a review from remlapmot March 19, 2026 14:50
Copy link
Copy Markdown
Contributor

@remlapmot remlapmot left a comment

Choose a reason for hiding this comment

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

Superb work Ryan.

My short course practical is actually giving basically the same estimates as the R one now - will email.

I have added a small regression test.

…x_categories_for_predict

Add isinstance check to silence pyright warning on CategoricalDtype
@remlapmot remlapmot merged commit 8aa225a into main Mar 19, 2026
4 checks passed
@ryan-odea ryan-odea deleted the fix-nan-creation branch March 20, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants