1

Using the package bnlearn, is it possible to set a node to not be able to have any parents? I've found it is technically possible using the blacklist function. Example preventing "A" from having any parents in the included test data:

library(bnlearn)
blacklist = data.frame(from = c("B", "C", "D", "E", "F"), to = c("A"))
dat = gs(learning.test, blacklist = blacklist)

However, I'm working with data that has tens of thousands of nodes which should not be parents to each other, resulting in a blacklist that would be millions of lines long. I'm essentially looking for something like:

blacklist = data.frame(from = c("*", "A"))

Meaning no node can be a parent of A. Is this possible? If not, is there a Bayesian learning package anyone can recommend that has this functionality?

splicer
  • 11
  • 2
  • Can there be nodes which can have some of them as parents but not all of them? – ggsdc Jan 05 '17 at 16:34
  • Essentially about half the data can only be parents, and can not have them (they are DNA markers) and the other half can have children and parents (expression data). I'm looking for a way to tell bnlearn that the DNA markers can not have parents, and instead can only BE parents to the expression data. Thanks! – splicer Jan 05 '17 at 17:56
  • The example http://www.bnlearn.com/research/genetics14/ may help you to reduce the search space / blacklist matrix. It learns the markov blanket, then blacklists the associations found in the necessary direction ie so a variable will be a potential parent but not child – user20650 Jan 05 '17 at 23:02

1 Answers1

0

Also using blacklists but a bit more generic, you could do:

node.names <- names(learning.test)
blacklist <- data.frame(from = node.names[-grep("A", node.names)], 
                        to   = c("A"))
Flavia
  • 298
  • 1
  • 6