We will work with the same network used for the previous exercise, and we will plot the network using the bnviewer package:
- We formulate the same model as before, with the same code:
library("bnviewer")library("bnlearn")data = read.csv("https://archive.ics.uci.edu/ml/machine-learning-databases/abalone/abalone.data")colnames(data) = c("sex","length","diameter","height","whole_weight", "shucked_weight", "viscera_weight", "shell_weight","rings") data$rings = log(data$rings) dag = model2network("[sex][length|sex][diameter|sex][height|sex] [whole_weight|length:diameter:height][shucked_weight|length:diameter:height] [viscera_weight|length:diameter:height][shell_weight|length:diameter:height] [rings|whole_weight:shucked_weight:viscera_weight:shell_weight]") ...