# Looking for similar functionality as Weka BayesNet and editor

**URL:** <https://discourse.pymc.io/t/looking-for-similar-functionality-as-weka-bayesnet-and-editor/2884>\
**Category:** Questions\
**Created:** [March 9, 2019, 10:46pm UTC](https://discourse.pymc.io/t/looking-for-similar-functionality-as-weka-bayesnet-and-editor/2884 "2019-03-09T22:46:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![legoleg](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@legoleg](https://discourse.pymc.io/u/legoleg)\
**Post date:** [March 9, 2019, 10:46pm UTC](https://discourse.pymc.io/t/looking-for-similar-functionality-as-weka-bayesnet-and-editor/2884/1 "2019-03-09T22:46:11Z")

</div>

Hello,  
I’m pretty new to Bayesian networks, but I was able to figure out a few things in Weka with the gui and the BayesNet algorithm. I’m trying to do the same thing programmatically in Python, and I wasn’t able to with the Weka wrapper. What I’d like to do is learn categories from a term document matrix with about 1300 columns(each is a word). After I have my model learned, I’d like to be able to do two things… 1.) to set evidence/observation to a category and see the probabilities per word change, and 2.) also send in a 1300 column vector and get a prediction as to the category it belongs to. Are these things possible using PyMC? Is there a tutorial/documentation doing something similar? I’ve looked and haven’t found anything yet. Thank you very much!

Oleg

---

<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:** [March 10, 2019, 9:15am UTC](https://discourse.pymc.io/t/looking-for-similar-functionality-as-weka-bayesnet-and-editor/2884/2 "2019-03-10T09:15:01Z")

</div>

Sounds like you are describing a latent dirichlet allocation (LDA): [https://docs.pymc.io/notebooks/lda-advi-aevb.html](https://docs.pymc.io/notebooks/lda-advi-aevb.html)

---

<div class="post-metadata">

**Author:** ![legoleg](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@legoleg](https://discourse.pymc.io/u/legoleg)\
**Post date:** [March 11, 2019, 5:10am UTC](https://discourse.pymc.io/t/looking-for-similar-functionality-as-weka-bayesnet-and-editor/2884/3 "2019-03-11T05:10:57Z")

</div>

Would you know about setting up just a BayesNet type network. I understand the very basics of it, and I can see how to explain it. It would be a good exercise form to start from that and then compare with other ones. I’m familiar with Weka and would like to get to something like this ([https://www.cs.waikato.ac.nz/~remco/weka\_bn/node20.html](https://www.cs.waikato.ac.nz/~remco/weka_bn/node20.html)) but programmatically. I’d like to learn a network from data, then set some evidence, and be able to see how it changed.

I have found this library that is able to read the same XMLBIF files that Weka creates/reads ([https://programtalk.com/vs2/?source=python/10105/pgmpy/pgmpy/tests/test\_readwrite/test\_XMLBIF.py](https://programtalk.com/vs2/?source=python/10105/pgmpy/pgmpy/tests/test_readwrite/test_XMLBIF.py))

---

<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:** [March 11, 2019, 7:21am UTC](https://discourse.pymc.io/t/looking-for-similar-functionality-as-weka-bayesnet-and-editor/2884/4 "2019-03-11T07:21:03Z")

</div>

I have never work with Weka before. @ericmjl works quite a lot with network kind of data, maybe he knows?

---

<div class="post-metadata">

**Author:** ![ericmjl](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ericmjl/32/196_2.png) [@ericmjl](https://discourse.pymc.io/u/ericmjl)\
**Post date:** [March 14, 2019, 6:02pm UTC](https://discourse.pymc.io/t/looking-for-similar-functionality-as-weka-bayesnet-and-editor/2884/5 "2019-03-14T18:02:25Z")

</div>

I’m afraid I’m not able to help in this particular case. BayesNets - while I have heard the term, I’ve never formally learned it (either self-studied or in class). It may be that I know something about it, but I’m just unaware at the moment.

---

<div class="post-metadata">

**Author:** ![legoleg](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@legoleg](https://discourse.pymc.io/u/legoleg)\
**Post date:** [March 15, 2019, 7:50pm UTC](https://discourse.pymc.io/t/looking-for-similar-functionality-as-weka-bayesnet-and-editor/2884/6 "2019-03-15T19:50:27Z")

</div>

Thank you for your replies, I may need to try PyMC later. I was able to get pretty far with the Weka wrapper, here’s a link with some working code:  
[https://groups.google.com/forum/?utm\_medium=email&utm\_source=footer#!msg/python-weka-wrapper/qF4vw\_6sqAA/EmqTph1NAAAJ](https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/python-weka-wrapper/qF4vw_6sqAA/EmqTph1NAAAJ)

---

<div class="post-metadata">

**Author:** ![legoleg](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@legoleg](https://discourse.pymc.io/u/legoleg)\
**Post date:** [March 18, 2019, 6:42pm UTC](https://discourse.pymc.io/t/looking-for-similar-functionality-as-weka-bayesnet-and-editor/2884/7 "2019-03-18T18:42:59Z")

</div>

It looks like Weka has an underflow issue with large graphs…  
[http://weka.8497.n7.nabble.com/NaN-in-margins-of-an-editableBayesNet-td44721.html](http://weka.8497.n7.nabble.com/NaN-in-margins-of-an-editableBayesNet-td44721.html)  
So I’d like to try PyMC. Is it possible to learn a Bayesian network from data like the network shown in the first post here:  
[https://discourse.pymc.io/t/making-a-query-for-a-simple-bn-made-in-pymc3/2663/16](https://discourse.pymc.io/t/making-a-query-for-a-simple-bn-made-in-pymc3/2663/16)  
It sounds like I could then set my observation to a specific value in my class and then get the most influential attributes, is that correct? Is there a good tutorial for this? What are the right terms to use when talking about PyMC?
