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
1 answer

bnlearn, hill-climbing algorithm: how can I get alternative structures in the order of score?

In the R package of "bnlearn", the function "hc" only derives the most plausible structure in a score (e.g., bic, aic). But, I want to know alternative structures in the order of plausibility (i.e., score). For example, when three nodes were given…
이희승
  • 23
  • 3
0
votes
1 answer

Causality map changing when order of the variables are changed

I am using bnlearn and pcalg R packages to obtain the causality map from the datasets. There is an order-independent algorithm which claims to be independent of variables are given as input. When I change the order the variables, directions of…
Artiga
  • 776
  • 2
  • 16
  • 37
0
votes
1 answer

R package bnlearn: cpquery vs predict - different results?

I want to use my bayesian network as a classifier, first on complete evidence data (predict), but also on incomplete data (bnlearn::cpquery). But it seems that, even working with the same evidence, the functions give different results (not only…
locom
  • 115
  • 9
0
votes
1 answer

Can't get official bnlearn tutorial on "Creating custom fitted Bayesian networks" to run

I'm looking at the official tutorial here. I copied their code exactly but RStudio is giving me error messages for the lines , , B = GOOD (error message: unexpected ',' in ",") and dfit (error message: object dfit not found). Here's the exact code I…
JohnDoeVsJoeSchmoe
  • 671
  • 2
  • 8
  • 25
0
votes
1 answer

R: variable has different number of levels in the node and in the data

I want to use bnlearn for a classification task with Naive Bayes algorithm. I use this data set for my tests. Where 3 variables are continuous ()V2, V4, V10) and others are discrete. As far as I know bnlearn cannot work with continuous variables, so…
nabroyan
  • 3,225
  • 6
  • 37
  • 56
0
votes
1 answer

Laplace smoothig for Bayesian Netoworks in bnlearn

I'm trying to work with Bayesian Networks using R and currently I am using bnlearn framework. I'm trying to use score based structural learning from data and try different algorithms and approaches. I would like to know if there is Laplace smoothing…
nabroyan
  • 3,225
  • 6
  • 37
  • 56
0
votes
1 answer

Bayesian Netwotk structure learning

Using the bnlearn package I can learn the structure of a BN just by passing my dataset as parameter, for example: bn1 <- blnearn :: hc (dataset) Or must I pass some edges as prior knowledge eg: wl = data.frame (from = c ("A", "B"), to = c ("B",…
0
votes
1 answer

bnlearn error in structural.em

I got an error when try to use structural.em in "bnlearn" package This is the code: cut.learn<- structural.em(cut.df, maximize = "hc", + maximize.args = "restart", + fit="mle", fit.args = list(), + impute =…
Wantidah
  • 21
  • 2
0
votes
1 answer

R blearn - subgraph function error : nodes must be a vector of character strings

What am I missing here? I already cleaned the workspace and restartet the session. Here is my the part of the code that seems to cause trouble. I am trying to average an bayesian networks arc strenghts from a strength object, then save all nodes of…
Phise
  • 11
  • 2
0
votes
0 answers

Score bic may be used with discrete data only

I have a data frame with all columns in discrete format. I apply the following code to generate a BN using bnlearn package. However I get this error that says "score 'bic' may be used with discrete data only" while essentially my data are discrete!…
13554N
  • 37
  • 9
0
votes
0 answers

** caught segfault *** address 0xfffffffc0fcd6248, cause 'memory not mapped'

Hi every one I am working on shiny app using bnlearn for Bayesian networks and using r studio I get a fatal error and when I use R GUI I get this error ** caught segfault *** address 0xfffffffc0fcd6248, cause 'memory not mapped' Traceback:…
ou2105
  • 165
  • 3
  • 10
0
votes
0 answers

Bayesian inference in R bnlearn, values of the arcs wanted, model whitelisted

I'm running Rstudio with the bnlearn package installed. I want the influences of different parent nodes on the children (with confidence intervals if possible). I have: my dataset, made into factors (25 variables, 200 cases). my whitelist of all…
0
votes
1 answer

Error in build.whitelist: unknown node label present in the whitelist

I am still new to using R (only a few months), and I am trying to build a Bayesian network (BN) for my research (biology). I have already done all this with discrete variables, however, I am now trying to integrate continuous as well, which I know…
GMD886
  • 1
  • 3
-1
votes
1 answer

Why do I get "Error in check.data(data, allow.levels = TRUE)" when using predict in bnlearn

The training data: With R I need to then make 2 predictions (Buy Computer: YES/NO) based on these features Essentially to say whether it would be Yes or No for each of the two. I've tried the code below and get the error Error in check.data(data,…
1 2 3 4 5
6