Bnlearn

Latest version: v0.8.7

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

Scan your dependencies

Page 5 of 13

0.7.1

* smooth parameter added to `parameter_learning`


import bnlearn as bn
DAG = bn.import_DAG('water', verbose=0)
Sampling
df = bn.sampling(DAG, n=1000)
Parameter learning
model = bn.parameter_learning.fit(DAG, df, smooth=None)

0.7.0

* Fix for plotting due to new version of ``networkx``. The version of ``networkx`` should be >= 2.7.1
* Layout can now be changed more easily
* figsize added as an input parameter which is more convenient than width/height.


import bnlearn as bn
df = bn.import_example('asia')
model = bn.structure_learning.fit(df)
Plot
bn.plot(model)
Plot with different layouts
bn.plot(model, params_static={'layout':'spectral_layout'})
bn.plot(model, params_static={'layout':'planar_layout'})
bn.plot(model, params_static={'layout':'kamada_kawai_layout'})
bn.plot(model, params_static={'layout':'spring_layout'})
bn.plot(model, params_static={'layout':'circular_layout', "figsize": (15, 10)})

0.6.3

* added `pyvis `to setup file and requirements.

0.6.2

* fix for `bn.print_CPD()`
* name convention: bayesianmodel into bayesiannetwork

0.6.1

* Name convention: BayesianModel is changed into BayesianNetwork

0.6.0

* New conversion functionalities to convert source-target vector into sparse dataframe: `vec2df `
* Sphinx pages updated: https://erdogant.github.io/bnlearn/pages/html/dataframe%20conversions.html
* Docstrings updated and included.


import bnlearn as bn
Load large example with source-target edges
vec = bn.import_example("stormofswords")
Convert to dataframe
df = bn.vec2df(vec['source'], vec['target'], weights=vec['weight'])

Page 5 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.