0

I'm trying this notebook but on float numbers

https://github.com/erdogant/bnlearn/blob/master/notebooks/bnlearn.ipynb

Has anyone used "structure_learning.fit()" from bnlearn with float numbers?

My chart is blank. When I run a simple correlation on my dataframe, I get results so is not a a dataframe problem.

Another hint about my hypotheses : When I transform my float to binary, it works

user20650
  • 24,654
  • 5
  • 56
  • 91
minattosama
  • 263
  • 1
  • 9
  • If you want to use continuous variables you could try http://openturns.github.io/otagrum/master/ or you could try calling [the actual R package `bnlearn`](https://www.bnlearn.com/) using a py/R wrapper ; example [here](https://stackoverflow.com/questions/59462337/importing-any-function-from-an-r-package-into-python?answertab=votes#tab-top). I seem to remember seeing someone working on a fuller python wrap of the R package on github but can't find it now (due to unfortunate naming of this new, unrelated, bnlearn python package) – user20650 Nov 04 '21 at 12:56
  • Hey, thanks a lot. I'm going to try this and get back at you. Thanks for the help, is better than nothing – minattosama Feb 02 '22 at 11:09

1 Answers1

0

Bnlearn in python only works with binary and not with cont values. This library is an adaptation of an R library so not everything is done. Currently P(A/B) can be done only for binary problems in this library. Please check the math of P(A/B) to understand

minattosama
  • 263
  • 1
  • 9
  • Its not a "adaptation of an R library ". It wraps functionality of https://github.com/pgmpy/pgmpy, so unrelated code-wise to R's bnlearn – user20650 Nov 08 '21 at 14:08