Hi all. I am Koji Miyazawa, a data scientist based in Japan. I work with healthcare data and Bayesian models.
I saw a few questions here about hierarchical models for choice-based conjoint (CBC) in PyMC, for example:
I wrote a small open-source package called partworth.
GitHub - kojikojikojikoji/partworth: Hierarchical Bayes choice-based conjoint analysis in Python (PyMC), with Sawtooth-style outputs and a market simulator · GitHub (pip install partworth)
It has:
- checks for long-format choice data, tasks of different sizes and a “none” option
- hierarchical MNL with correlated coefficients (non-centred, LKJ prior) and an optional negative price coefficient for every respondent
- part-worths per respondent, importances, RLH and a Sawtooth-style utilities CSV
- a market simulator with credible intervals, price curves and WTP
I compared it with R bayesm on the public camera data. Respondent-level posterior means correlate at 0.997 or more, and the hold-out hit rate is 0.729 vs 0.730. The repo also has a parameter recovery test and lists the targets that are not met yet.
It is pre-alpha. I would like feedback on the model and defaults.