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

ID Class Prediction #56

Closed mohrezazali closed 6 months ago

mohrezazali commented 6 months ago

Hi, I need to do predict_class and I need all rows with the same ID get the same class. I have ID, X1, X2 and Y. Could you let me know how I can incorporate ID column in the a StepMix model to perform class assignments while taking ID into account? In FLEXMIX in R the following code worked perfectly, but I need to know I can reproduce the same results with StepMix:

fmm4 <- stepFlexmix(.~0|id,k=4,nrep=3, model=list(FLXMR...

many rows have the same id, but I want to make sure all rows with the same id will be in the same class. Thanks

sachaMorin commented 6 months ago

If by this you mean repeated measures (e.g., for the same person), you may want to consider RMLCA as discussed in this issue which would require to reshape your input data matrix. StepMix does not support long data.

mohrezazali commented 6 months ago

Thanks for the explanation.

sachaMorin commented 6 months ago

Closing. Feel free to reopen if needed.