From c4e594dbfacb2bf6cad6cfc1578473139b389d4e Mon Sep 17 00:00:00 2001 From: ViciOs <791105792@qq.com> Date: Mon, 29 May 2017 19:41:44 +0800 Subject: [PATCH 1/2] fix kullback_leibler doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the return value range should in <0,+∞> --- gensim/matutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gensim/matutils.py b/gensim/matutils.py index fbfa383a34..7bf628cc58 100644 --- a/gensim/matutils.py +++ b/gensim/matutils.py @@ -446,7 +446,7 @@ def isbow(vec): def kullback_leibler(vec1, vec2, num_features=None): """ A distance metric between two probability distributions. - Returns a distance value in range <0,1> where values closer to 0 mean less distance (and a higher similarity) + Returns a distance value in range <0,+∞> where values closer to 0 mean less distance (and a higher similarity) Uses the scipy.stats.entropy method to identify kullback_leibler convergence value. If the distribution draws from a certain number of docs, that value must be passed. """ From ee3c6cadc57e381450d461cb8d837ed57493803c Mon Sep 17 00:00:00 2001 From: ViciOs <791105792@qq.com> Date: Tue, 30 May 2017 22:17:47 +0800 Subject: [PATCH 2/2] add space after , --- gensim/matutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gensim/matutils.py b/gensim/matutils.py index 7bf628cc58..ebe98db69f 100644 --- a/gensim/matutils.py +++ b/gensim/matutils.py @@ -446,7 +446,7 @@ def isbow(vec): def kullback_leibler(vec1, vec2, num_features=None): """ A distance metric between two probability distributions. - Returns a distance value in range <0,+∞> where values closer to 0 mean less distance (and a higher similarity) + Returns a distance value in range <0, +∞> where values closer to 0 mean less distance (and a higher similarity) Uses the scipy.stats.entropy method to identify kullback_leibler convergence value. If the distribution draws from a certain number of docs, that value must be passed. """