Why is my learned Bayesian network not rooted at the binary class variable?

48 Views Asked by At

I want to compare bankrupt firm profiles among different countries using Bayesian Networks (pomegranate library in Python). The class is a binary variable (1=bankrupt, 0=active company), and the rest are financial features.

I get two very different BN structures for the two countries with Class at the top of the structure for the 1st country and lower for the 2nd.

BN for country X BN for country Y

Why is it happening? How can I compare the structures among countries if Class is not the parent?

Here is my code for plotting the BN structures:

from pomegranate import *
import graphviz
model = BayesianNetwork.from_samples(X=df[['WC/TA', 'RE/TA', 'EBIT/TA', 'BVE/TL', 'Class']].values, algorithm='exact', state_names=altman_features + ['Class'])
p = model.log_probability(X = df[['WC/TA', 'RE/TA', 'EBIT/TA', 'BVE/TL', 'Class']].values).sum()

model.plot()
0

There are 0 best solutions below