# Zoo module in 3.2 for storing predefined model sketches

**URL:** <https://discourse.pymc.io/t/zoo-module-in-3-2-for-storing-predefined-model-sketches/119>\
**Category:** Development\
**Created:** [June 25, 2017, 8:48am UTC](https://discourse.pymc.io/t/zoo-module-in-3-2-for-storing-predefined-model-sketches/119 "2017-06-25T08:48:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ferrine](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ferrine/32/10_2.png) [@ferrine](https://discourse.pymc.io/u/ferrine)\
**Post date:** [June 25, 2017, 8:48am UTC](https://discourse.pymc.io/t/zoo-module-in-3-2-for-storing-predefined-model-sketches/119/1 "2017-06-25T08:48:14Z")

</div>

I’m still worried about our pm.glm that is not good design. If we add more models we’ll need more such files in scope. I think we should refactor that in a single module with different models.

Also GLM should be refactored into tensor variable subclass. We did similar things in `TransformedRV`, `Minibatch` and `ObservedRV` with clever `theano.compile.view_op` usage. We’ll get intuitive design that way.

---

<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 25, 2017, 9:54am UTC](https://discourse.pymc.io/t/zoo-module-in-3-2-for-storing-predefined-model-sketches/119/2 "2017-06-25T09:54:32Z")

</div>

I agree with this (maybe not with `Zoo` as the name tho). To me, I prefer the specific functional module in a submodule:

```auto
- zoo 
  - GLM
  - GP
  - ODE?
  - Mixture models?
  - ...

```

---

<div class="post-metadata">

**Author:** ![ferrine](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ferrine/32/10_2.png) [@ferrine](https://discourse.pymc.io/u/ferrine)\
**Post date:** [June 25, 2017, 10:26am UTC](https://discourse.pymc.io/t/zoo-module-in-3-2-for-storing-predefined-model-sketches/119/3 "2017-06-25T10:26:45Z")

</div>

Ye, this design lgtm

---

<div class="post-metadata">

**Author:** ![ferrine](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ferrine/32/10_2.png) [@ferrine](https://discourse.pymc.io/u/ferrine)\
**Post date:** [June 25, 2017, 10:32am UTC](https://discourse.pymc.io/t/zoo-module-in-3-2-for-storing-predefined-model-sketches/119/4 "2017-06-25T10:32:12Z")

</div>

I also have the following proposal

- models
  - base (moved `pm.model`)
  - GLM
  - GP
  - ODE?
  - Mixture models?
  - …

---

<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 26, 2017, 6:32am UTC](https://discourse.pymc.io/t/zoo-module-in-3-2-for-storing-predefined-model-sketches/119/5 "2017-06-26T06:32:18Z")

</div>

Hmm, I would prefer pm.model being a more general class.

Also, for each zoo module, we can have some classical and model specific algorithm for model fitting. It would be cool to then compare with general inference method such as NUTS and VI

---

<div class="post-metadata">

**Author:** ![ferrine](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ferrine/32/10_2.png) [@ferrine](https://discourse.pymc.io/u/ferrine)\
**Post date:** [June 27, 2017, 1:11pm UTC](https://discourse.pymc.io/t/zoo-module-in-3-2-for-storing-predefined-model-sketches/119/6 "2017-06-27T13:11:31Z")

</div>

`pm.Model` will be the base class for all the rest. That’s why I want to move it to `base.py`
