CLN Remove unnecessary operation in mutual_info
@@ -137,13 +137,13 @@ def _compute_mi_cd(c, d, n_neighbors):
kd = KDTree(c)
m_all = kd.query_radius(c, radius, count_only=True, return_distance=False)
- m_all = np.array(m_all) - 1.0
+ m_all = np.array(m_all)
mi = (
digamma(n_samples)
+ np.mean(digamma(k_all))
- np.mean(digamma(label_counts))
- - np.mean(digamma(m_all + 1))
+ - np.mean(digamma(m_all))
)
return max(0, mi)
