Questions tagged [pgmpy]
34 questions
1
vote
2 answers
Problem in prediction using Bayesian model in python
I am using simple titanic dataset to predict the survived data using bayesian networks.Though i am able to make the structure through structure learning but after i put my test dataset after in bayesian model it shows key error as though i am able…

Bibhu Kalyan das
- 41
- 1
- 4
1
vote
0 answers
where is TreeCPD in version 0.1.9
I am following the book "Mastering Probabilistic Graphical Models using Python". The book's code is with an older version, but I have installed the latest version 0.1.9
So I am, not finding some of the functions used in the book. Some of the…

R71
- 4,283
- 7
- 32
- 60
1
vote
1 answer
variable elimination inference.map_query error for BayesianModel
I was trying to compute the MAP Query over the variables given the evidence.
from pgmpy.inference import VariableElimination
from pgmpy.models import BayesianModel
import numpy as np
import pandas as pd
values = pd.DataFrame(np.random.randint(low=0,…

Himanshu Poddar
- 7,112
- 10
- 47
- 93
1
vote
0 answers
Belief propagation using pgmpy lib - algorithm understanding
I am now starting to use pgmpy lib for probabailistic graphical model implementation. The probability that I get using this lib differs from the one I get manually (e.g. using SamIam).
Here is a screenshot of the very small graphical model made in…

Olga
- 11
- 1
0
votes
0 answers
I get an error when importing PCselect from pgmpy.estimators what could be the issue
I get this error when I tried importing PCselect from pgmpy:
ImportError Traceback (most recent call last)
Cell In[31], line 1
----> 1 from pgmpy.estimators import PCSelect
2 from pgmpy.models import BayesianModel…

Oditian4
- 1
0
votes
1 answer
Saving pgmpy CPDs to PDF or excel file
I am using Expectation Maximization to do parameter learning with Bayesian networks in pgmpy. In my code, I successfully 'train' the Bayesian network to learn the CPDs from labeled data and I am able to perform inference using new observable data.
I…

hunterlineage
- 13
- 3
0
votes
0 answers
pgmpy Bayesian Network with discrete inputs and continuous variable outputs
I have a Bayesian network that is supposed to compute marginal posterior probabilities of 'fault variables', which are continuous values between 0 and 1, given discrete 'observable variable' data (this discrete data are not probabilities). For this,…

hunterlineage
- 13
- 3
0
votes
1 answer
Define Bayesian Network and do Parameter Training with pgmpy
I want to create a BayesianNetwork with pgmpy in python. I know the names of my nodes, and the edges, essentially the structure of the graph of my Bayesian network. I want to train the Bayesian network with 'labeled' data; this means I do not have…

hunterlineage
- 13
- 3
0
votes
1 answer
Key Error in Python when using tuples. But when I print, I see it in the keys
I am trying to write an algorithm for Loopy Belief Propagation. I am using Numpy and pGMpy. The goal is to first initialize messages from nodes to factor. Then at each iteration, you will calculate the factor to nodes messages, then update the…

dlu
- 13
- 2
0
votes
0 answers
Python package for parameter estimation in PGMs with continuous variables
I am looking for a Python package to work on a probabilistic graphical model (PGM) with categorical and continous variables. Some nodes in the PGM are latent variables. The conditional probabilities are defined by continuous functions such as Beta…

Kowshika
- 1
0
votes
1 answer
Find probability of a single occurrence in map_query in pgmpy
I am working on a bayesian network which looks like this
bn
I want to find the probability of P(+j|-e) which means that finding the probability that JohnCalls is true given earthquake is false. Here is the code that I wrote which includes the…
user11665646
0
votes
1 answer
Load a .dne file in pgmpy
The popular proprietary software Netica uses, among others, the .dne format to store Bayesian networks.
How can I load a .dne file in pgmpy?

Jsevillamol
- 2,425
- 2
- 23
- 46
0
votes
2 answers
Bayesian Network Python
How can I find the Bayesian network (of a survey data that I have) using python. I am planning to use the pgmpy library and test different structure learning algorithms (like: PC, Hill climbing, Tabu, K2.....) to find the network and dependencies of…

Salma AlBreiki
- 5
- 2
0
votes
1 answer
How can I order an inference result using bnlearn in Python?
So, I'm using the Python bnlearn package and when you make the inference a table with probabilistic data is returned. The problem is that I have a lot of data and it would be more interesting if the table were ordered descending. I have no idea how…

Lekash
- 1
- 2
0
votes
1 answer
The "pip install pgmpy" statement for Python in Jupyter Notebook does not work
When I try to install "pgmpy" in the Jupyter notebook using the statement "pip install pgmpy", the notebook stays in a "busy" state, with the hourglass icon staying there for a very long time. Every time I try to install it, it has been loading for…

Nachiket Kulkarni
- 121
- 1
- 7