Learn R Programming

bnlearn (version 3.1)

bn class: The bn class structure

Description

The structure of an object of the bn S3 class.

Arguments

Details

An object of class bn is a list containing at least the following components:

  • learning: a list containing some information about the results of the learning algorithm. It's never changed afterward.
    • whitelist: a sanitized copy of thewhitelistparameter (a two-column matrix, whose columns are labeledfromandto).
    • blacklist: a sanitized copy of theblacklistparameter (a two-column matrix, whose columns are labeledfromandto).
    • test: the label of the conditional independence test used by the learning algorithm (a character string). The label of the network score is used for score-based and hybrid algorithms, and "none" for randomly generated graphs.
    • ntests: the number of conditional independence tests or score comparisons used in the learning (an integer value).
    • algo: the label of the learning algorithm or the random generation algorithm used to generate the network (a character string).
    • args: a list. The values of the parameters of either the conditional tests or the scores used in the learning process. Only the relevant ones are stored, so this may be an empty list.
      • alpha: the target nominal type I error rate (a numeric value) of the conditional independence tests.
      • iss: a positive numeric value, the imaginary sample size used by thebgeandbdescores.
      • phi: a character string, eitherheckermanorbottcher; used by thebgescore.
      • k: a positive numeric value, the penalty per parameter used by theaic,aic-g,bicandbic-gscores.
      • prob: the probability of each arc to be present in a graph generated by theorderedgraph generation algorithm.
      • burn.in: the number of iterations for theic-daggraph generation algorithm to converge to a stationary (and uniform) probability distribution.
      • max.degree: the maximum degree for any node in a graph generated by theic-daggraph generation algorithm.
      • max.in.degree: the maximum in-degree for any node in a graph generated by theic-daggraph generation algorithm.
      • max.out.degree: the maximum out-degree for any node in a graph generated by theic-daggraph generation algorithm.
      • training: a character string, the label of the training node in a Bayesian network classifier.
  • nodes: a list. Each element is named after a node and contains the following elements:
    • mb: the Markov blanket of the node (a vector of character strings).
    • nbr: the neighbourhood of the node (a vector of character strings).
    • parents: the parents of the node (a vector of character strings).
    • children: the children of the node (a vector of character strings).
  • arcs: the arcs of the Bayesian network (a two-column matrix, whose columns are labeledfromandto). Undirected arcs are stored as two directed arcs with opposite directions between the corresponding incident nodes.

Additional (optional) components under learning:

  • optimized: whether additional optimizations have been used in the learning algorithm (a boolean value).
  • restrict: the label of the constraint-based algorithm used in theRestrictphase of a hybrid learning algorithm (a character string).
  • rtest: the label of the conditional independence test used in theRestrictphase of a hybrid learning algorithm (a character string).
  • maximize: the label of the score-based algorithm used in theMaximizephase of a hybrid learning algorithm (a character string).
  • maxscore: the label of the network score used in theMaximizephase of a hybrid learning algorithm (a character string).