Bayesian network¶
The Bayesian network is the main graphical model of pyAgrum. A Bayesian network is a directed probabilistic graphical model based on a DAG. It represents a joint distribution over a set of random variables. In pyAgrum, the variables are (for now) only discrete.
A Bayesian network uses a directed acyclic graph (DAG) to represent conditional independence in the joint distribution. These conditional independence allow to factorize the joint distribution, thereby allowing to compactly represent very large ones.
\[P(X_1,\cdots,X_n)=\prod_{i=1}^n P(X_i | Parents(X_i))\]
Moreover, inference algorithms can also use this graph to speed up the computations. Finally, the Bayesian networks can be learnt from data.
Tutorial
Reference
- Model
BayesNetBayesNet.add()BayesNet.addAMPLITUDE()BayesNet.addAND()BayesNet.addArc()BayesNet.addArcs()BayesNet.addCOUNT()BayesNet.addEXISTS()BayesNet.addFORALL()BayesNet.addLogit()BayesNet.addMAX()BayesNet.addMEDIAN()BayesNet.addMIN()BayesNet.addNoisyAND()BayesNet.addNoisyOR()BayesNet.addNoisyORCompound()BayesNet.addNoisyORNet()BayesNet.addOR()BayesNet.addSUM()BayesNet.addStructureListener()BayesNet.addVariables()BayesNet.addWeightedArc()BayesNet.ancestors()BayesNet.arcs()BayesNet.beginTopologyTransformation()BayesNet.changePotential()BayesNet.changeVariableLabel()BayesNet.changeVariableName()BayesNet.check()BayesNet.children()BayesNet.clear()BayesNet.completeInstantiation()BayesNet.connectedComponents()BayesNet.cpt()BayesNet.dag()BayesNet.descendants()BayesNet.dim()BayesNet.empty()BayesNet.endTopologyTransformation()BayesNet.erase()BayesNet.eraseArc()BayesNet.exists()BayesNet.existsArc()BayesNet.family()BayesNet.fastPrototype()BayesNet.generateCPT()BayesNet.generateCPTs()BayesNet.hasSameStructure()BayesNet.idFromName()BayesNet.ids()BayesNet.isIndependent()BayesNet.jointProbability()BayesNet.loadBIF()BayesNet.loadBIFXML()BayesNet.loadDSL()BayesNet.loadNET()BayesNet.loadO3PRM()BayesNet.loadUAI()BayesNet.log10DomainSize()BayesNet.log2JointProbability()BayesNet.maxNonOneParam()BayesNet.maxParam()BayesNet.maxVarDomainSize()BayesNet.minNonZeroParam()BayesNet.minParam()BayesNet.minimalCondSet()BayesNet.moralGraph()BayesNet.moralizedAncestralGraph()BayesNet.names()BayesNet.nodeId()BayesNet.nodes()BayesNet.nodeset()BayesNet.parents()BayesNet.reverseArc()BayesNet.saveBIF()BayesNet.saveBIFXML()BayesNet.saveDSL()BayesNet.saveNET()BayesNet.saveO3PRM()BayesNet.saveUAI()BayesNet.size()BayesNet.sizeArcs()BayesNet.thisownBayesNet.toDot()BayesNet.topologicalOrder()BayesNet.variable()BayesNet.variableFromName()BayesNet.variableNodeMap()
- Tools for Bayesian networks
- Inference
- Learning
BNLearnerBNLearner.G2()BNLearner.addForbiddenArc()BNLearner.addMandatoryArc()BNLearner.addPossibleEdge()BNLearner.chi2()BNLearner.correctedMutualInformation()BNLearner.currentTime()BNLearner.databaseWeight()BNLearner.domainSize()BNLearner.epsilon()BNLearner.eraseForbiddenArc()BNLearner.eraseMandatoryArc()BNLearner.erasePossibleEdge()BNLearner.fitParameters()BNLearner.getNumberOfThreads()BNLearner.hasMissingValues()BNLearner.history()BNLearner.idFromName()BNLearner.isGumNumberOfThreadsOverriden()BNLearner.latentVariables()BNLearner.learnBN()BNLearner.learnDAG()BNLearner.learnEssentialGraph()BNLearner.learnMixedStructure()BNLearner.learnParameters()BNLearner.logLikelihood()BNLearner.maxIter()BNLearner.maxTime()BNLearner.messageApproximationScheme()BNLearner.minEpsilonRate()BNLearner.mutualInformation()BNLearner.nameFromId()BNLearner.names()BNLearner.nbCols()BNLearner.nbRows()BNLearner.nbrIterations()BNLearner.periodSize()BNLearner.pseudoCount()BNLearner.rawPseudoCount()BNLearner.recordWeight()BNLearner.score()BNLearner.setDatabaseWeight()BNLearner.setEpsilon()BNLearner.setForbiddenArcs()BNLearner.setInitialDAG()BNLearner.setMandatoryArcs()BNLearner.setMaxIndegree()BNLearner.setMaxIter()BNLearner.setMaxTime()BNLearner.setMinEpsilonRate()BNLearner.setNumberOfThreads()BNLearner.setPeriodSize()BNLearner.setPossibleEdges()BNLearner.setPossibleSkeleton()BNLearner.setRecordWeight()BNLearner.setSliceOrder()BNLearner.setVerbosity()BNLearner.state()BNLearner.use3off2()BNLearner.useAprioriBDeu()BNLearner.useAprioriDirichlet()BNLearner.useAprioriSmoothing()BNLearner.useBDeuPrior()BNLearner.useDirichletPrior()BNLearner.useEM()BNLearner.useGreedyHillClimbing()BNLearner.useK2()BNLearner.useLocalSearchWithTabuList()BNLearner.useMDLCorrection()BNLearner.useMIIC()BNLearner.useNMLCorrection()BNLearner.useNoApriori()BNLearner.useNoCorrection()BNLearner.useNoPrior()BNLearner.useScoreAIC()BNLearner.useScoreBD()BNLearner.useScoreBDeu()BNLearner.useScoreBIC()BNLearner.useScoreK2()BNLearner.useScoreLog2Likelihood()BNLearner.useSmoothingPrior()BNLearner.verbosity()