Bnlearn

Latest version: v0.8.7

Safety actively analyzes 631073 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 13

0.7.13

* Fix for import examples (requires latest numpy version)
* replaced wget with internal python function.

0.7.12

* Added cdn resources to fix interactive plot in jupyter notebook and Colab

0.7.11

* Fix for interactive plot. It did not show up correctly but now it does again.

0.7.10

* `sklearn `is changed to `scikit-learn` in the setup and requirements (issue 66 )

0.7.9

* plot function `bn.plot(model)` return figure axis.
* Setup file contains import of `python-louvain` instead of `community`
* docstring updates regarding this output.

**Example:**

model = bn.import_DAG('sprinkler', CPD=True)
df = bn.sampling(model, n=1000, methodtype='bayes')
fig = bn.plot(model)
fig['ax']

0.7.8

* Added functionality to compute sctructure scores when using parameter of structure learning. This can help to decide which scoring type may give a better fit ('bic', 'k2', 'bdeu'). The results scores are directly stored in the output.


import bnlearn as bn

Load example dataset
df = bn.import_example('sprinkler')

edges = [('Cloudy', 'Sprinkler'),
('Cloudy', 'Rain'),
('Sprinkler', 'Wet_Grass'),
('Rain', 'Wet_Grass')]

Make the actual Bayesian DAG
DAG = bn.make_DAG(edges)
model = bn.parameter_learning.fit(DAG, df)

model['structure_scores']

Page 3 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.