问题
I need to compute information content from two Python lists. I understand that I can use the following formula where the probabilities are computed from the histograms of the list.
Information content = sum_ij p(x_i,y_j) log_2 ( p(x_i,y_j)/(p(x_i)p(y_j) ) / - sum_i p(y_i) log_2 p(y_i) .
Is there any built in Python API to compute information content? Thanks.
回答1:
Check out the information_content
function in the biopython
library: http://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc303
来源:https://stackoverflow.com/questions/43301878/computing-information-content-in-python