Computing information content in Python

自作多情 提交于 2019-12-12 03:32:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!