Jensen-Shannon Divergence

前端 未结 5 1502
醉话见心
醉话见心 2021-01-31 05:22

I have another question that I was hoping someone could help me with.

I\'m using the Jensen-Shannon-Divergence to measure the similarity between two probability distribu

5条回答
  •  耶瑟儿~
    2021-01-31 06:28

    Since the Jensen-Shannon distance (distance.jensenshannon) has been included in Scipy 1.2, the Jensen-Shannon divergence can be obtained as the square of the Jensen-Shannon distance:

    from scipy.spatial import distance
    
    distance.jensenshannon([1.0/10, 9.0/10, 0], [0, 1.0/10, 9.0/10]) ** 2
    # 0.5306056938642212
    

提交回复
热议问题