Biology Reference
In-Depth Information
> library(snow)
> cl = makeCluster(2, type = "SOCK")
> clusterSetupSPRNG(cl)
> clusterEvalQ(cl, library(bnlearn))
> sachs = read.table("code/sachs.data.txt",
+ header = TRUE)
> dsachs = discretize(sachs, method = "hartemink",
+ breaks = 3, ibreaks = 60)
> clusterExport(cl, list("dsachs"))
> nodes = names(dsachs)
> start = random.graph(nodes = nodes,
+ method = "melancon", num = 50)
> netlist = parLapply(cl, start, function(net) {
+ hc(dsachs, score = "bde", iss = 10, start = net)})
> rnd = custom.strength(netlist, nodes = nodes)
> rnd[(rnd$strength > 0.85) & (rnd$direction >= 0.5), ]
> avg.start = averaged.network(rnd, threshold = 0.85)
> stopCluster(cl)
Search WWH ::




Custom Search