You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.
The text was updated successfully, but these errors were encountered: