Labo-Lacourse / stepmix

A Python package following the scikit-learn API for model-based clustering and generalized mixture modeling (latent class/profile analysis) of continuous and categorical data. StepMix handles missing values through Full Information Maximum Likelihood (FIML) and provides multiple stepwise Expectation-Maximization (EM) estimation methods.
https://stepmix.readthedocs.io/en/latest/index.html
MIT License
54 stars 4 forks source link

Sample method #45

Closed pcomw closed 1 year ago

pcomw commented 1 year ago

First, thank you for the wonderful package. Second, apologies if this is a foolish issue to raise.

I'm having difficulty implementing the sample() method. For example, when I run the code in the first tutorial, and attempt to run model.sample(10), I receive the error "TypeError: 'NoneType' object is not subscriptable", pointing to line 1326 of stepmix.py Y[shuffle_mask].

If I'm using the method incorrectly, then I would be grateful if its proper use could be documented in a tutorial. Thanks!

sachaMorin commented 1 year ago

Hey thanks for reporting this! Definitely a bug when trying to sample a model with no structural model (i.e., no Y). Will fix