# Is a Bayesian network doing feature selection?

I have just started playing around and reading about Bayes Nets. Here is a snippet of code using the bnlearn package in R, which seems to be a fantastic tool.

install.packages("bnlearn")
library(bnlearn)

data <- data.frame(matrix(c("sunny","hot","high","weak","no",
"sunny","hot","high","strong","no",
"overcast","hot","high","weak","yes",
"rain","mild","high","weak","yes",
"rain","cool","normal","weak","yes",
"rain","cool","normal","strong","no",
"overcast","cool","normal","strong","yes",
"sunny","mild","high","weak","no",
"sunny","cool","normal","weak","yes",
"rain","mild","normal","weak","yes",
"sunny","mild","normal","strong","yes",
"overcast","mild","high","strong","yes",
"overcast","hot","normal","weak","yes",
"rain","mild","high","strong","no"), byrow = TRUE,
dimnames = list(day = c(),
condition = c("outlook","temperature",
"humidity","wind","playtennis")), nrow=14, ncol=5))

res = hc(data)
plot(res)


This graph that is fit using the hill climbing algorithm has two nodes that are not directed: Outlook and wind. Is it fair to say that these random variables are unrelated to the others and a sort of feature selection is occurring?

• Do you mean two arcs that are not directed. Nodes cannot be directed or undirected. – Jane Wayne Aug 22 '14 at 17:32