Open xiuwenibm opened 4 months ago
Currently, the implemented Bayesian networks have to be categorical. This means that the data have to correspond to integer categories ranging from 0 to n-1 (inclusive) when there are n categories, and so are non-negative.
Got it! Thanks! So for continuous values, I just need to bin them and then apply Bayesian networks
I created a BayesianNetwork and fit the data:
model = BayesianNetwork(algorithm="chow-liu", max_parents=max_parents)
model.fit(data)
In
fit
method, it calls_learn_structure
method, however, in_learn_structure
, it does the parameter check:X = _check_parameter(_cast_as_tensor(X), "X", min_value=0, ndim=2, dtypes=(torch.int32, torch.int64))
The min_value = 0, so if there is a negtive value in my dataset, the check will raise an error. But BayesianNetwork should work for negative values too.