Movatterモバイル変換


[0]ホーム

URL:


bnRep

CRAN statusLast-commitLifecycle: stable

The R packagebnRep includes the largest repository ofBayesian networks, which were all collected from recent academicliterature in a variety of fields! If you are using any Bayesian networkfrombnRep you should cite:

Leonelli, M. (2025). bnRep: A repository of Bayesian networks fromthe academic literature. Neurocomputing, 624, 129502.

@Article{,    title = {bn{R}ep: A repository of {B}ayesian networks from the academic literature},    author = {Manuele Leonelli},    journal = {Neurocomputing},    volume = {624},    year = {2025},    pages = {129502}  }

Go tohttps://manueleleonelli.shinyapps.io/bnRep/ to explorethe repository online!

Contribution

If you are interested in having your Bayesian network included inbnRep you must prepare three objects:

You can submit the required objects directly via github (e.gfork/pull), or via email.

If you struggle with any of these steps, please get in touch and Iwill try to help!

Overview

bnRep includes over 200 Bayesian networks from more than150 academic publications. It includes discrete, Gaussian andconditional linear Gaussian Bayesian networks, all stored as appropriatebn.fit objects frombnlearn. They can beexported for use to other software (e.g. Phython libraries) usingfunctions frombnlearn such aswrite.bif().Recall that in order to plot the associated DAG, one must first convertit to a graph object withbn.net() from thebnlearn package.

Installation

# Install stable version from CRAN:install.packages("bnRep")# Or the development version from GitHub:remotes::install_github("manueleleonelli/bnRep")

Usage

We will use thelawschool Bayesian network as anexample. To load it in the environment simply calldata(lawschool) and to then plot it (for instance usinggraphviz.plot from thebnlearn package)

library(bnRep)library(bnlearn)library(qgraph)data("lawschool")qgraph::qgraph(bn.net(lawschool))

Notice that the functionbn.net function must be used inorder to plot the network.

Exploring bnRep

bnRep includes two features to explore the Bayesiannetworks in the repository:

Here’s the columns ofbnRep_summary:

#>  [1] "Name"                   "Type"                   "Structure"             #>  [4] "Probabilities"          "Graph"                  "Area"                  #>  [7] "Nodes"                  "Arcs"                   "Parameters"            #> [10] "Avg. Parents"           "Max Parents"            "Avg. Levels"           #> [13] "Max Levels"             "Average Markov Blanket" "Year"                  #> [16] "Journal"                "Reference"

An overview ofthe Bayesian networks in bnRep

The following plots show some summary statistics of therepository.

#> Warning: package 'ggplot2' was built under R version 4.3.3


[8]ページ先頭

©2009-2025 Movatter.jp