用Python计算信息内容 [英] Computing information content in Python
本文介绍了用Python计算信息内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从两个Python列表中计算信息内容.我了解我可以使用以下公式,其中概率是根据列表的直方图计算的.
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.
信息内容= 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).
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) .
是否有内置的Python API计算信息内容?谢谢.
Is there any built in Python API to compute information content? Thanks.
推荐答案
查看biopython
库中的information_content
函数:
查看全文