Why won't my colab display all columns when printing cpd from pgmpy

Viewed 138

The blow colab workbook is displaying different information for me after I run it than it's showing online. Why? It's cutting of the number of columns shown.

Learning Bayesian Networks

What is being shown: enter image description here

After I run the code:

enter image description here

Notice the ... reducing the number of columns shown. How do I fix this?

I have tried:

pd.set_option('expand_frame_repr', False)
1 Answers

This happens due to a configuration hard coded in the pgmy's CPD implementation.

Here's how to fix:

  1. Navigate to pgmpy/factors/discrete/CPD.py
  2. Around Line 231, you'll find cdf_str = self._truncate_strtable(cdf_str)
  3. Comment out this line.

It should now be working. There should be a pgmpy-specific config command that should fix this in a better way but I couldn't find one.

Related