Package: bnlearn 5.0.1

Marco Scutari

bnlearn: Bayesian Network Structure Learning, Parameter Learning and Inference

Bayesian network structure learning, parameter learning and inference. This package implements constraint-based (PC, GS, IAMB, Inter-IAMB, Fast-IAMB, MMPC, Hiton-PC, HPC), pairwise (ARACNE and Chow-Liu), score-based (Hill-Climbing and Tabu Search) and hybrid (MMHC, RSMAX2, H2PC) structure learning algorithms for discrete, Gaussian and conditional Gaussian networks, along with many score functions and conditional independence tests. The Naive Bayes and the Tree-Augmented Naive Bayes (TAN) classifiers are also implemented. Some utility functions (model comparison and manipulation, random data generation, arc orientation testing, simple and advanced plots) are included, as well as support for parameter estimation (maximum likelihood and Bayesian) and inference, conditional probability queries, cross-validation, bootstrap and model averaging. Development snapshots with the latest bugfixes are available from <https://www.bnlearn.com/>.

Authors:Marco Scutari [aut, cre], Tomi Silander [ctb]

bnlearn_5.0.1.tar.gz
bnlearn_5.0.1.tar.gz(r-4.5-noble)bnlearn_5.0.1.tar.gz(r-4.4-noble)
bnlearn.pdf |bnlearn.html
bnlearn/json (API)

# Install 'bnlearn' in R:
install.packages('bnlearn', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Uses libs:
  • openblas– Optimized BLAS
Datasets:
  • alarm - ALARM monitoring system (synthetic) data set
  • asia - Asia (synthetic) data set by Lauritzen and Spiegelhalter
  • clgaussian.test - Synthetic (mixed) data set to test learning algorithms
  • coronary - Coronary heart disease data set
  • gaussian.test - Synthetic (continuous) data set to test learning algorithms
  • hailfinder - The HailFinder weather forecast system (synthetic) data set
  • insurance - Insurance evaluation network (synthetic) data set
  • learning.test - Synthetic (discrete) data set to test learning algorithms
  • lizards - Lizards' perching behaviour data set
  • marks - Examination marks data set

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

147 exports 53 stars 7.03 score 0 dependencies 30 dependents 113 mentions 1.4k scripts 20.8k downloads

Last updated 29 days agofrom:443571479a. Checks:OK: 2. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 11 2024
R-4.5-linux-x86_64OKSep 11 2024

Exports:acyclicadd.nodealpha.staramatamat<-ancestorsaracnearc.strengtharcsarcs<-as.bnas.bn.fitas.grainas.graphAMas.graphNELas.igraphas.lmaveraged.networkBFbf.strengthblacklistbn.bootbn.cvbn.fitbn.fit.barchartbn.fit.dotplotbn.fit.histogrambn.fit.qqplotbn.fit.xyplotbn.netboot.strengthcextendchildrenchildren<-chow.liuci.testcolliderscomparecompelled.arcscomplete.graphconfigscount.graphscpdagcpdistcpquerycustom.fitcustom.strengthdedupdegreedescendantsdirecteddirected.arcsdiscretizedrop.arcdrop.edgedsepempty.graphfast.iambgbn2mvnormgraphviz.chartgraphviz.comparegraphviz.plotgsHh2pchamminghchpciambiamb.fdridentifiableimputein.degreeincident.arcsinclusion.thresholdincoming.arcsincrement.test.counterinter.iambisolated.nodesKLleaf.nodeslearn.mblearn.nbrlossmbmmhcmmpcmodel2networkmodelstringmodelstring<-moralmutilatedmvnorm2gbnnaive.bayesnarcsnbrnnodesnode.orderingnodesnodes<-nparamsntestsordering2blacklistout.degreeoutgoing.arcsparentsparents<-path.existspc.stablepdag2dagrandom.graphrbnread.bifread.dscread.netremove.noderename.nodesreset.test.counterreverse.arcreversible.arcsroot.nodesrsmax2scoreset.arcset.edgeset2blacklistshdshielded.colliderssi.hiton.pcsingularskeletonspousesstrength.plotstructural.emsubgraphtabutest.countertiers2blacklisttree.bayesundirected.arcsunshielded.collidersvstructswhitelistwrite.bifwrite.dotwrite.dscwrite.net

Dependencies:

Readme and manuals

Help Manual

Help pageTopics
Bayesian network structure learning, parameter learning and inferencebnlearn-package bnlearn
ALARM monitoring system (synthetic) data setalarm
Estimate the optimal imaginary sample size for BDe(u)alpha.star
Drop, add or set the direction of an arc or an edgearc operations drop.arc drop.edge reverse.arc set.arc set.edge
Measure arc strengtharc.strength averaged.network bf.strength boot.strength custom.strength inclusion.threshold mean.bn.strength
Asia (synthetic) data set by Lauritzen and Spiegelhalterasia
Bayes factor between two network structuresBF
The bn class structurebn class bn-class
Nonparametric bootstrap of Bayesian networksbn.boot
Cross-validation for Bayesian networksbn.cv loss plot.bn.kcv plot.bn.kcv.list
Fit the parameters of a Bayesian network$<-.bn.fit bn.fit bn.net custom.fit
The bn.fit class structurebn.fit class bn.fit-class bn.fit.dnode bn.fit.gnode
Plot fitted Bayesian networksbn.fit plots bn.fit.barchart bn.fit.dotplot bn.fit.histogram bn.fit.qqplot bn.fit.xyplot
Utilities to manipulate fitted Bayesian networksAIC.bn.fit BIC.bn.fit bn.fit utilities coef.bn.fit coef.bn.fit.cgnode coef.bn.fit.dnode coef.bn.fit.gnode coef.bn.fit.onode fitted.bn.fit fitted.bn.fit.cgnode fitted.bn.fit.dnode fitted.bn.fit.gnode identifiable logLik.bn.fit residuals.bn.fit residuals.bn.fit.cgnode residuals.bn.fit.dnode residuals.bn.fit.gnode sigma sigma.bn.fit sigma.bn.fit.cgnode sigma.bn.fit.gnode singular
The bn.kcv class structurebn.kcv class bn.kcv-class bn.kcv.list class bn.kcv.list-class
The bn.strength class structurebn.strength bn.strength class bn.strength-class
Independence and conditional independence testsci.test
Synthetic (mixed) data set to test learning algorithmsclgaussian.test
Compare two or more different Bayesian networksall.equal.bn compare graphviz.compare hamming shd
Construct configurations of discrete variablesconfigs
Constraint-based structure learning algorithmsconstraint-based algorithms fast.iamb gs hpc iamb iamb.fdr inter.iamb mmpc pc.stable si.hiton.pc
Coronary heart disease data setcoronary
Equivalence classes, moral graphs and consistent extensionscextend colliders cpdag moral shielded.colliders unshielded.colliders vstructs
Perform conditional probability queriescpdist cpquery mutilated
Pre-process data to better learn Bayesian networksdedup discretize
Test d-separationdsep
Read and write BIF, NET, DSC and DOT filesread.bif read.dsc read.net write.bif write.dot write.dsc write.net
Synthetic (continuous) data set to test learning algorithmsgaussian.test
Import and export networks from the gRain packageas.bn.fit as.bn.fit.grain as.bn.grain as.grain as.grain.bn as.grain.bn.fit gRain integration
Count graphs with specific characteristicscount.graphs graph enumeration
Generate empty, complete or random graphscomplete.graph empty.graph graph generation utilities random.graph
Import and export networks from the graph packageas.bn.graphAM as.bn.graphNEL as.graphAM as.graphAM.bn as.graphAM.bn.fit as.graphNEL as.graphNEL.bn as.graphNEL.bn.fit graph integration
Utilities to manipulate graphsacyclic directed graph utilities path path,bn-method path,bn.fit-method path,bn.naive-method path,bn.tan-method path.exists pdag2dag skeleton subgraph
Plotting networks with probability barsgraphviz.chart
Advanced Bayesian network plotsgraphviz.plot
The HailFinder weather forecast system (synthetic) data sethailfinder
Hybrid structure learning algorithmsh2pc hybrid algorithms mmhc rsmax2
Import and export networks from the igraph packageas.bn.igraph as.igraph as.igraph.bn as.igraph.bn.fit igraph integration
Conditional independence testsindependence tests independence-tests
Compute the distance between two fitted Bayesian networksH KL
Insurance evaluation network (synthetic) data setinsurance
Synthetic (discrete) data set to test learning algorithmslearning.test
Lizards' perching behaviour data setlizards
Produce lm objects from Bayesian networksas.lm as.lm.bn as.lm.bn.fit as.lm.bn.fit.gnode lm integration
Local discovery structure learning algorithmsaracne chow.liu local discovery algorithms
Examination marks data setmarks
Miscellaneous utilitiesamat amat<- ancestors arcs arcs<- children children<- compelled.arcs degree degree,bn-method degree,bn.fit-method degree,bn.naive-method degree,bn.tan-method descendants directed.arcs in.degree incident.arcs incoming.arcs isolated.nodes leaf.nodes mb misc utilities narcs nbr nnodes nodes nodes,bn-method nodes,bn.fit-method nodes,bn.naive-method nodes,bn.tan-method nparams ntests out.degree outgoing.arcs parents parents<- reversible.arcs root.nodes spouses undirected.arcs
Build a model string from a Bayesian network and vice versaas.bn as.bn.character as.character.bn model string utilities model2network modelstring modelstring<-
Gaussian Bayesian networks and multivariate normalsgbn2mvnorm mvnorm2gbn
Naive Bayes classifiersnaive.bayes predict.bn.naive predict.bn.tan tree.bayes
Bayesian network Classifiersnetwork classifiers network-classifiers
Network scoresnetwork scores network-scores
Manipulate nodes in a graphadd.node node operations nodes<- nodes<-,bn-method nodes<-,bn.fit-method nodes<-,bn.naive-method nodes<-,bn.tan-method remove.node rename.nodes
Partial node orderingsnode ordering utilities node.ordering
Import and export networks from the pcalg packageas.bn.pcAlgo pcalg integration
Plot a Bayesian networkplot.bn
Plot arc strengths derived from bootstrapplot.bn.strength
Predict or impute missing data from a Bayesian networkimpute predict.bn.fit
Simulate random samples from a given Bayesian networkrbn
Score of the Bayesian networkAIC.bn BIC.bn logLik.bn score score,bn-method score,bn.naive-method score,bn.tan-method
Score-based structure learning algorithmshc score-based algorithms tabu
Discover the structure around a single nodelearn.mb learn.nbr single-node local discovery
Arc strength plotstrength.plot
Structure learning from missing dataem-based algorithms structural.em
Structure learning algorithmsstructure learning structure-learning
Manipulating the test counterincrement.test.counter reset.test.counter test.counter
Get or create whitelists and blacklistsblacklist ordering2blacklist set2blacklist tiers2blacklist whitelist
Whitelists and blacklists in structure learningwhitelists and blacklists whitelists-blacklists