Skip to content

Instantly share code, notes, and snippets.

@haluk
Created April 21, 2015 17:45
Show Gist options
  • Save haluk/221e8e1bf32cbd1b6477 to your computer and use it in GitHub Desktop.
Save haluk/221e8e1bf32cbd1b6477 to your computer and use it in GitHub Desktop.
library(bnlearn)
options(echo=TRUE)
args <- commandArgs(trailingOnly = TRUE)
print(args)
data <- read.table(args[1], sep = ",", header = TRUE)
col_names <- names(data)
data[, col_names] <- lapply(data[,col_names] , factor)
start = random.graph(nodes = names(data), num = 100)
netlist = lapply(start, function(net) {
hc(data, score = "bic", iss = 1, start = net) })
save.image(file = "/home/otu/hdogan/bnp_R/bnp_R_image.gzip", compress=TRUE)
q()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment