So, I'm using the Python bnlearn package and when you make the inference a table with probabilistic data is returned. The problem is that I have a lot of data and it would be more interesting if the table were ordered descending. I have no idea how to manipulate that. The class of the 'table' is pgmpy.factors.discrete.DiscreteFactor.DiscreteFactor.
This is how the table looks like
Is it possible to manipulate?
The source code of pgmpy.factors.discrete.DiscreteFactor.DiscreteFactor indicates that the possible values of the variable are stored in the
state_names
member dictionary, and the actual probabilities in thevalues
member as a numpy array. You can order with a clause similar to