# Complaint Monday - What has been bothering you about PyMC?

**URL:** <https://discourse.pymc.io/t/complaint-monday-what-has-been-bothering-you-about-pymc/12296>\
**Category:** Development\
**Tags:** development\
**Created:** [June 12, 2023, 8:19am UTC](https://discourse.pymc.io/t/complaint-monday-what-has-been-bothering-you-about-pymc/12296 "2023-06-12T08:19:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricardoV94](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ricardov94/32/5775_2.png) [@ricardoV94](https://discourse.pymc.io/u/ricardoV94)\
**Post date:** [June 12, 2023, 8:19am UTC](https://discourse.pymc.io/t/complaint-monday-what-has-been-bothering-you-about-pymc/12296/1 "2023-06-12T08:19:50Z")

</div>

Feel free to write any issues / bugs / missing features that have been bothering you.

Would love to hear from our users 🙂

---

<div class="post-metadata">

**Author:** ![jaharvey8](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/jaharvey8/32/6688_2.png) [@jaharvey8](https://discourse.pymc.io/u/jaharvey8)\
**Post date:** [June 14, 2023, 12:16am UTC](https://discourse.pymc.io/t/complaint-monday-what-has-been-bothering-you-about-pymc/12296/2 "2023-06-14T00:16:33Z")

</div>

Saving then loading a trace and model so that you can make new out of sample predictions with a previously created model still feels awkward and clunky. And, given how common this practice this is, it seems like there should be an example notebook versus new users having to search the discourse for how to do this.

---

<div class="post-metadata">

**Author:** ![ricardoV94](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ricardov94/32/5775_2.png) [@ricardoV94](https://discourse.pymc.io/u/ricardoV94)\
**Post date:** [June 14, 2023, 5:09am UTC](https://discourse.pymc.io/t/complaint-monday-what-has-been-bothering-you-about-pymc/12296/3 "2023-06-14T05:09:42Z")

</div>

What do you think of [Using ModelBuilder class for deploying PyMC models — PyMC example gallery](https://www.pymc.io/projects/examples/en/latest/howto/model_builder.html) ?

It is being developed to try and answer the problem you mention.

---

<div class="post-metadata">

**Author:** ![jaharvey8](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/jaharvey8/32/6688_2.png) [@jaharvey8](https://discourse.pymc.io/u/jaharvey8)\
**Post date:** [June 14, 2023, 10:49am UTC](https://discourse.pymc.io/t/complaint-monday-what-has-been-bothering-you-about-pymc/12296/4 "2023-06-14T10:49:44Z")

</div>

Oh wow, I knew this was being developed but I was unaware that it had been added to pymc-experimental. This looks great, I’ll try it out.

Regarding my “complaint”, and getting philosophical for a second, I think pymc exists in this realm where it’s like you make these super amazing models that are highly descriptive and you infer and learn a lot about your data. But then it kind of stops there, predicting on new data is time consuming. Whereas machine learning exists more as like you’ll make these models, not really know why it works and won’t really learn anything about the data. But it’ll be really easy to predict on new data. So I think this functionality is going to be really powerful and helps bridge that “learn about your data” and “deploy on new data” gap.

---

<div class="post-metadata">

**Author:** ![juststarted](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/juststarted/32/1997_2.png) [@juststarted](https://discourse.pymc.io/u/juststarted)\
**Post date:** [June 15, 2023, 7:20am UTC](https://discourse.pymc.io/t/complaint-monday-what-has-been-bothering-you-about-pymc/12296/5 "2023-06-15T07:20:57Z")

</div>

As a preliminary remark, I love the PyMC framework, I have been using it for years and I think it’s an amazing project. That being said, I usually fit models on a server, and since I often work with pretty heavy likelihood functions & a lot of data the fitting time can easily exceed the maximum job length. This is a problem because there still is no way of interrupting sampling, saving the trace, and restarting from where it left off. McBackend is meant to do this but something is broken (see [this issue](https://github.com/michaelosthege/mcbackend/issues/93)). I imagine this is a fairly common problem for other users as well, so any improvement on this front would be awesome!

---

<div class="post-metadata">

**Author:** ![ricardoV94](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ricardov94/32/5775_2.png) [@ricardoV94](https://discourse.pymc.io/u/ricardoV94)\
**Post date:** [June 15, 2023, 8:05pm UTC](https://discourse.pymc.io/t/complaint-monday-what-has-been-bothering-you-about-pymc/12296/6 "2023-06-15T20:05:53Z")

</div>

I think that libraries like blackjax make resuming sampling much easier because the samplers are written in a functional paradigm. @junpenglao may be able to confirm or deny.

I wonder if nutpie makes this easier as well? CC @aseyboldt

Our native samplers should also be able to do this but would require refactoring. Simple samplers like Metropolis and Slice should be easy (not too many tuning variables to keep track of). NUTS may be a tough beast though.

---

<div class="post-metadata">

**Author:** ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)\
**Post date:** [June 16, 2023, 4:24am UTC](https://discourse.pymc.io/t/complaint-monday-what-has-been-bothering-you-about-pymc/12296/7 "2023-06-16T04:24:44Z")

</div>

Yep you can use blackjax for that as it is written to be more modular. I think it wont even take that much of a refactoring for our native sampler to do so.

---

<div class="post-metadata">

**Author:** ![juststarted](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/juststarted/32/1997_2.png) [@juststarted](https://discourse.pymc.io/u/juststarted)\
**Post date:** [June 19, 2023, 7:30am UTC](https://discourse.pymc.io/t/complaint-monday-what-has-been-bothering-you-about-pymc/12296/8 "2023-06-19T07:30:27Z")

</div>

Thanks for the help!

Unfortunately [my model](https://discourse.pymc.io/t/trying-to-speed-up-a-model-with-custom-likelihood/11302) does not compile with any of those (nutpie, blackjax, numpyro) and I haven’t found a way to debug the problem. It likely has to do with some complicated shape issue / the scan operation. It runs fine with `pm.sample` and parameter recovery even worked well with a (much) smaller dataset than the one I have (though variational inference did not - the posterior for the last component of a dirichlet was systematically underestimated).
