Questions tagged [pomegranate]

Question related to Pomegranate library in Python (https://github.com/jmschrei/pomegranate). Pomegranate is a library for probabilistic modeling in Python and CPython.

25 questions
6
votes
5 answers

Bayesian network in Python: both construction and sampling

For a project, I need to create synthetic categorical data containing specific dependencies between the attributes. This can be done by sampling from a pre-defined Bayesian Network. After some exploration on the internet, I found that Pomegranate is…
Rutger Mauritz
  • 153
  • 1
  • 12
5
votes
3 answers

Sample from a Bayesian network in pomegranate

I constructed a Bayesian network using from_samples() in pomegranate. I'm able to get maximally likely predictions from the model using model.predict(). I wanted to know if there is a way to sample from this Bayesian network conditionally(or…
3
votes
0 answers

Representing disease and syptom in pomegranate bayes network

I'm trying to work out P(m|s) probability of meningitis given "stiff neck" So I'm trying to represent this in the model: P(m|s) = (P(s|m) * P(m))/P(s) P(s) = 0.1 P(m) = 0.0001 P(s|m) = 0.8 this is how I've represented it: meningitis =…
3
votes
0 answers

Supervised Learning HMM with Pomegranate

thanks for your help, I am new about this topic. I have a dataset composed of a sequence of binary observable variables associated with a label, like this. trainset = [ [0,0,1,0],[0,0,1,0],[0,0,0,1],...,] labels = [ 0,1,2,...,] states = 3 # number…
3
votes
2 answers

Can't plot pomegranate graph (pygraphviz not found)

I can't understand what is going on but I no longer seem to be able to plot a pomegranate graph from inside PyCharm. I'm using conda as package manager and have gone though the usual: conda install graphviz conda install python-graphviz but every…
Thomas Tiotto
  • 379
  • 1
  • 3
  • 12
2
votes
1 answer

Saving pomegranate Bayesian Network models

I am making some rather big Bayesian Networks for generating synthetic data, and I find pomegranate to be a good alternative as it generates data quickly and easily allows for inputting evidence. I have one problem with it: saving the trained…
Hakon
  • 23
  • 2
2
votes
1 answer

How to assign a belief/value to a node in a bayesian network, using predict_proba() from pomegranate

I'm trying to create my own bayesian network programme to model a very simple court ruling scenario using pomegranate, very similar to the monty hall problem which is well documented as an example of bayesian networks with pomegranate. I have made…
2
votes
1 answer

Trouble installing Pomegranate

I've tried pip installing Pomegranate a few times, and also downloaded and installed VisualStudio c++ Buildtools, version 14.0.25420.1 . Unfortunately I'm still having issues installing the package, as shown by the code below. Anyone have any advice…
Beatrix Kidco
  • 402
  • 5
  • 12
2
votes
0 answers

python pomegranate bayesian network initialization

I have using this module to train a bayesian network. I have this csv: c1, c2, c3, c4 # the columns names 1, 0, 0, 1 1, 0, 1, 1 1, 1, 0, 0 0, 0, 1, 0 0, 1, 0, 0 . . . I I have the edges of the network. I know that c1 -> c3, c2->c3, c2->c4. How…
Kenny Smith
  • 729
  • 3
  • 9
  • 23
2
votes
0 answers

Bayesian Networks: Structure Learning in Python is extremely slow compared to R

I'm currently working on a problem to do image classification on images using Bayesian Networks. I have tried using pomegranate, pgmpy and bnlearn. My dataset contains more than 200,000 images, on which I perform some feature extraction algorithm…
Hari Krishnan
  • 2,049
  • 2
  • 18
  • 29
1
vote
1 answer

UnboundLocalError: local variable 'dist' referenced before assignment

I am trying to train a model for supervised learning for Hidden Markov Model (HMM)and test it on a set of observations however, keep getting this error. The goal is to predict the state based on the observations. How can I fix this and how can I…
1
vote
0 answers

Why is my learned Bayesian network not rooted at the binary class variable?

I want to compare bankrupt firm profiles among different countries using Bayesian Networks (pomegranate library in Python). The class is a binary variable (1=bankrupt, 0=active company), and the rest are financial features. I get two very different…
1
vote
1 answer

How to get Mean and Covariance value from pomegranate Gaussian Mixture model

In the scikit learn Gaussian mixture model we can get mean and covariance by clf = GaussianMixture(n_components=num_clusters, covariance_type="tied", init_params='kmeans') for i in range(clf.n_components): cov=clf.covariances_[i] …
iforcebd
  • 87
  • 11
1
vote
0 answers

Errno 13 while attempting to plot an HMM with pomegranate

I'm trying to plot an HMM model, implemented through the usage of the Pomegranate library. Calling the plot method with model.plot() invokes the following error: PermissionError Traceback (most recent call…
Balthus89
  • 11
  • 3
1
vote
3 answers

pomegranate unable to detect existing pygraphviz

I am trying to work with Pomegranate package in python 3.7, Win 10 environment. I had trouble with installing pygraphviz package (It was a nightmare). I finally ended up installing the package following this post. Now, when I tried working with…
PPR
  • 395
  • 1
  • 5
  • 17
1
2