예제 #1
0
    def test_fine_tuned_modularity_density_normalized(self):

        community_array = fine_tuned_clustering_qds(self.G, seed=100)

        computed_metric = modularity_density(self.adj, community_array,
                                             np.unique(community_array))

        assert_equal(round(computed_metric, 4), 0.2313)
예제 #2
0
    def test_constrained_fine_tuned_modularity_density_size2(self):

        community_array = \
                constrained_fine_tuned_clustering_qds(self.G,
                                                      cluster_size=13,
                                                      seed=100)

        computed_metric = modularity_density(self.adj, community_array,
                                             np.unique(community_array))

        assert_equal(round(computed_metric, 4), 0.2230)
예제 #3
0
    def test_fine_tuned_modularity_density_2(self):

        community_array = fine_tuned_clustering_qds(self.G,
                                                    normalize=False,
                                                    evd_method='lobpcg',
                                                    seed=2)

        computed_metric = modularity_density(self.adj, community_array,
                                             np.unique(community_array))

        assert_equal(round(computed_metric, 4), 0.2382)