Questions tagged [bnlearn]

bnlearn is an R package for learning the graphical structure of Bayesian networks, estimate their parameters and perform some useful inference.

bnlearn is an R package for learning the graphical structure of Bayesian networks, estimate their parameters and perform some useful inference. To get started and install the latest development snapshot type

install.packages(​"http://www.bnlearn.com/releases/​bnlearn_latest.tar.gz") in your R console.

Package webpage: http://www.bnlearn.com/

89 questions
0
votes
0 answers

How long does it take to run a network 2500 nodes in BNLEARN?

I have a discrete (3 states) network w/ ~ 2500 nodes that I am running in BNLEARN via R. As it stands, it has been running for about 5 1/2 days. I am trying to estimate how long it will take. Is there anyway I can calcuate this? I am using a laptop…
0
votes
0 answers

Learn a DAG with undirected graph as starting point

I have an undirected graph (i.e. a set of undirected arcs). Bnlearn package doesn't seem to allow to learn from an undirected graph/network. For eg giving undirected graph for 'start' parameter in hill-climbing hc() function gives error "the graph…
Kumar
  • 43
  • 7
0
votes
0 answers

BDe score calculation

I tried to calculate BDe Score in R without using the built in function of different R packages. library(bnlearn) library(tidyverse) # Load the ALARM network # load("http://www.bnlearn.com/bnrepository/alarm/alarm.bif.gz") alarmNetwork_ls <-…
0
votes
0 answers

bn.fit and cluster objects?

I am having an issue get a bn.fit object to run; I have specified the nodes and arcs as follows: nodes <- empty.graph(names(df)) arcs =…
0
votes
0 answers

bnlearn Error in check.label, object 'graphviz.layouts' not found

Plotting a Bayesian network with graphviz.chart produces the following error: Error in check.label(layout, choices = graphviz.layouts, argname = "graph layout") : object 'graphviz.layouts' not found Code to…
Noir
  • 1
  • 1
0
votes
0 answers

Looking for R package or other possibility in R for General Bayesian Network Classification

Hello stackoverflow community, Im working on a uni-project in which we try to create Bayesian Network Classifier from data in R. Ideally the classifier should be based on a General Bayesian Network (GNB) or a BN Augmented Naive…
0
votes
0 answers

How to work around exceeded INT_MAX levels without reducing parent nodes in bnlearn R library?

I have been trying to build a Bayesian Network based on a dataset using bnlearn library in R, but I've been receiving the error shown below. Entered codes: library(bnlearn) bn.fit(dag, data = df, method = "bayes") Received error: Error in…
0
votes
0 answers

Drawing samples from a conditional bayesian network with bnlearn

I would like to draw samples from a conditional bayesian network (i.e. some input nodes without parents have no distributions attached), given input nodes values, with bnlearn. The solutions I have tried are inefficient, I would expect it to be as…
PierreC.
  • 28
  • 5
0
votes
0 answers

Fit undirected Bayesian Network with bnlearn

I learnt Bayesian Network (BN) structures with the bnlearn package in R. However, for some of my BN, I have undirected edges. Thus, when I want to fit the BN (i.e. learn the Conditional Probability Tables = CPT), I obtain this error message telling…
FrsLry
  • 348
  • 4
  • 19
0
votes
0 answers

Clustering in Bayesian Network Analysis (bnlearn)

everyone! I am new to this site, so please grant me patience if I'm doing this wrong or I incorrectly searched for this question and missed it in another forum. I'm currently a PhD student and trying to broaden my statistical toolkit. I'm trying to…
blmorgan
  • 23
  • 3
0
votes
0 answers

Graphviz is drawing DAGs with missig arrows and circle frames of the nodes

I'm experimenting with bnlearn R library and its DAGs. I'm new to R as well. I tried the code example here > tree = model2network("[A][B|A][C|A][D|A][E|B][F|B][G|C][H|C][I|C]") > graphviz.plot(tree, layout = "dot") but then I got this…
CiCi
  • 47
  • 1
  • 5
0
votes
1 answer

Why I'm receiving "Object" not found within this function?

query_averager <- function(arg1, arg2) { n = tibble() i = 1 while (i <= 100) { n[i] <- cpquery(fitted = fitted_bn_01, event = (ret == "Acima da Selic") , evidence = (solidez == arg1) & (resultado…
0
votes
1 answer

Convert string to names list index

I have a list with named objects that I would like to assign to by extracting the list index name from a character string. Using the below method I get the following error message: Error: attempt to apply non-function. Thus: test <- list(a = 'a', b…
Ollie Perkins
  • 333
  • 1
  • 12
0
votes
0 answers

BNlearn, gRain pEvidence issue with a Bayesian Network

I'm trying to get the likelihood of a data record to belong to a data set characterized by a Bayesian Network. Here is my current simple code: library(bnlearn) library(gRain) dag = hc(learning.test) fitted.bnlearn = bn.fit(dag, learning.test, method…
Michal T
  • 601
  • 5
  • 14
0
votes
1 answer

How to parallelise Bayesian network structure learning

How can I parallelize the hc algorithm from the package bnlearn? For example, how can I update the following code bn_k2 <- hc(x = dTrain, score = "k2",debug = F, optimized = T) My pc has 8 Core and when I run hc just one CPU is used. How can I…