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

NA or NaN not being accepted #5

Open
follhim opened this issue Jun 29, 2024 · 1 comment
Open

NA or NaN not being accepted #5

follhim opened this issue Jun 29, 2024 · 1 comment

Comments

@follhim
Copy link

follhim commented Jun 29, 2024

Hello,
When I came across this package, I was SUPER excited because this has everything I was looking for and more!
FIML, 3-step for covariates, and even BCH!

However I'm running into a problem:

Error in py_call_impl(callable, call_args$unnamed, call_args$named) : 
  ValueError: Input X contains NaN.
StepMix does not accept missing values encoded as NaN natively. For supervised learning, you might want to consider sklearn.ensemble.HistGradientBoostingClassifier and Regressor which accept missing values encoded as NaNs natively. Alternatively, it is possible to preprocess the data, for instance by using an imputer transformer in a pipeline or drop samples with missing values. See https://scikit-learn.org/stable/modules/impute.html You can find a list of all estimators that handle NaN values at the following page: https://scikit-learn.org/stable/modules/impute.html#estimators-that-handle-nan-values

Essentially, it's not happy that there is NaN, however I don't understand how to fix this. In your Notebook it simply works, but not for me.

Would greatly appreciate help on this matter!

@giguerch
Copy link
Collaborator

giguerch commented Jul 2, 2024

Hi Follhim,
Do you have the latest version of stepmix (on the python side), some bugs were corrected in the last months? If you can provide a simple example you can share where stepmixr doesn't work, I can try to help you.
Regards,
Charles-Édouard

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

No branches or pull requests

2 participants