Bnlearn

Latest version: v0.8.7

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

Scan your dependencies

Page 6 of 13

0.5.2

* Added new functionality **_vec2df_** to create dataframe from source-target-weights
* Added new example to demonstrate the usage
* updated some docstrings

Example **_vec2df_**:


import bnlearn as bn

source=['Cloudy','Cloudy','Sprinkler','Rain']
target=['Sprinkler','Rain','Wet_Grass','Wet_Grass']
weights=[1,2,1,3]

Convert into sparse datamatrix
df = bn.vec2df(source, target, weights=weights)

Cloudy Rain Sprinkler Wet_Grass
0 True False True False
1 True True False False
2 True True False False
3 False False True True
4 False True False True
5 False True False True
6 False True False True

0.5.1

* Improvements in independence test. It should also work now after parameter_learning.
* Improvements in plots
* Code refactoring

0.5.0

* implementation of `bnlearn.independence_test` functionality that allows to compute edge strength
* plots improved for the edge weights
* more pep styling
* some code refactoring


Example:

Load asia DAG
df = bn.import_example(data='alarm')
Structure learning of sampled dataset
model = bn.structure_learning.fit(df)
Compute edge strength with the chi_square test statistic. Set prune=True to remove the none-significant edges.
model = bn.independence_test(model, df, test='chi_square', prune=False)
Make plot
bn.plot(model)

0.4.11

* small fixes

0.4.10

* Bugfix when plotting when using edge_properties.
* added naivebayes method for creating DAG.
* added naivebayes method for structure learning.
* code refactoring.
* Updating docstrings.
* Updated unit tests

Let me know if there are accidental new bugs introduced!

0.4.9

* edge properties can be changed for plotting purposes
* color (per edge)
* weight (per edge)
* edge_alpha (overall)
* arrowstyle (overall)
* arrowsize (overall)

Page 6 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.