Releases: erdogant/bnlearn
Releases · erdogant/bnlearn
v0.7.1
v0.7.0
- Fix for plotting due to new version of
networkx
. The version ofnetworkx
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)})
v0.6.3
v0.6.2
0.6.1
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'])
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
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)