Similarity measurement based on (Student) t-Distribution

def _low_dim_sim(self, v, w, normalize=False, Y=None, idx=0):
        """Similarity measurement based on (Student) t-Distribution"""

        sim = (1 + np.linalg.norm(v - w) ** 2) ** -1

        if normalize:
            return sim / sum(map(lambda x: x[1], self._knn(idx, Y, high_dim=False)))
        else:
            return sim