def test_get_inter_cluster_prototype_distances(self): matrix = CondensedMatrix(squared_CH_table1) clusters = [Cluster(2, [1,2]),Cluster(3, [3,4]), Cluster(0, [0,5])] numpy.testing.assert_equal( get_inter_cluster_prototype_distances(clusters, matrix), [6.0, 11.0, 11.0])
def exponential_list_generation(cls, clustering, matrix): # May not work if prototypes are not defined :S proto_distances = numpy.array(get_inter_cluster_prototype_distances(clustering.clusters, matrix)) return numpy.exp(((proto_distances**2)/ -cls.TWO_SIGMA_SQUARED))