Reputation: 13
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.
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()
Upvotes: 1
Views: 41