Skip to content

Commit

Permalink
udpatting examples
Browse files Browse the repository at this point in the history
  • Loading branch information
erdogant committed Oct 7, 2024
1 parent c059934 commit 473728d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 290 deletions.
10 changes: 6 additions & 4 deletions bnlearn/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

for cii_test in cii_tests:
# Learn the DAG in data using hillclimbsearch and BIC
model = bn.structure_learning.fit(df, methodtype='pc', scoretype='bic', params_pc={'ci_test':cii_test,'alpha': 0.05}, verbose=3)
model = bn.structure_learning.fit(df, methodtype='pc', scoretype='bic', params_pc={'ci_test': cii_test,'alpha': 0.05}, verbose=3)
# model = bn.structure_learning.fit(df, methodtype='pc', params_pc={'ci_test':'freeman_tuckey','alpha': 0.05})

# Compute edge weights using ChiSquare independence test.
model = bn.independence_test(model, df, test='chi_square', prune=False)

# Plot the best DAG
bn.plot(model, edge_labels='pvalue', params_static={'maxscale': 4, 'figsize': (15, 15), 'font_size': 14, 'arrowsize': 10})
bn.plot(model)
Expand Down Expand Up @@ -182,9 +182,11 @@

# Load example mixed dataset
df = bn.import_example(data='auto_mpg')
del df['origin']

# Structure learning
model = bn.structure_learning.fit(df, methodtype='hc')
# model = bn.structure_learning.fit(df, methodtype='hc')
model = bn.structure_learning.fit(df, methodtype='pc', params_pc={'pearsonr': cii_test,'alpha': 0.05})

# Compute edge strength
model = bn.independence_test(model, df)
Expand Down
286 changes: 0 additions & 286 deletions bnlearn/tests/discretize/test_learn_discrete_bayes_net.py

This file was deleted.

0 comments on commit 473728d

Please sign in to comment.