15

I'd like to model a data set using Latent Class Analysis (LCA) using Python. I've found the Factor Analysis class in sklearn, but I'm not confident that this class is equivalent to LCA.

Does a package or class for LCA exist in Python?

Jessime Kirk
  • 654
  • 1
  • 6
  • 13
  • LCA is an important topic, so here's what I found: Single class implementation, relaying on numpy and scipy https://github.com/dasirra/latent-class-analysis Python implementation with examples: https://www.advancedrrmmodels.com/latent-class-models May be after a while I will validate those or come up with own code. – Julian Jul 14 '21 at 21:19

2 Answers2

5

At the moment, there is no package that provides LCA support in python. There are, however, many packages using different algorithms to perform LCA in R, for example (see the CRAN directory for more details):

  • BayesLCA Bayesian Latent Class Analysis
  • LCAextend Latent Class Analysis (LCA) with familial dependence in extended pedigrees
  • poLCA Polytomous variable Latent Class Analysis
  • randomLCA Random Effects Latent Class Analysis

Although not the same, there is a hierarchical clustering implementation in sklearn, you could check if that suits your needs.

Pakitochus
  • 51
  • 1
  • 2
0

StepMix provides LCA models in Python. Features include an sklean API and support for missing values.

Chu24
  • 1
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 17 '23 at 06:35