erdogant / bnlearn

Python library for learning the graphical structure of Bayesian networks, parameter learning, inference and sampling methods.
https://erdogant.github.io/bnlearn
Other
463 stars 45 forks source link

Structured Learning Issue #80

Closed Mr-Styles closed 1 year ago

Mr-Styles commented 1 year ago

Does not matter how I edit the data I'm using, running structured learning produces nothing; just with statistical noise some structure would have emerged.

erdogant commented 1 year ago

Can you demonstrate your issue with an example?Here are the docs with examples that should work.

Mr-Styles commented 1 year ago

I used your introduction examples:

model_hc_bic = bn.structure_learning.fit(train_df, methodtype='hc', scoretype='bic')

adjacency matrix:

model_hc_bic['adjmat']

plot model

G = bn.plot(model_hc_bic)

Result: Ajacemcy all FALSE. [bnlearn] >Computing best DAG using [hc] [bnlearn] >Set scoring type at [bic] [bnlearn] >Compute structure scores for model comparison (higher is better). [bnlearn]> Nothing to plot because no edges are present between nodes.

While not the same package, the R version of BNLearn works on this data.

erdogant commented 1 year ago

Which of the training examples is train_df?

Mr-Styles commented 1 year ago

Which of the training examples is train_df?

My own data; HillClimbSearch using pgmpy provides a structure as does the unrelated R library.

erdogant commented 1 year ago

I am closing this issue. When you have a working example to demonstrate this issue, feel free to re-open it. At this point, there is nothing I can do.