コード例 #1
0
def test_graph_str_basic():
    nx.set_node_attributes(graph, attr_str, attr_dict)
    cluster_object = AZPReactiveTabu(max_iterations=max_it, k1=k1, k2=k2,
                                     random_state=0)
    cluster_object.fit_from_networkx(graph, attr_str, n_regions=n_reg)
    result = region_list_from_array(cluster_object.labels_)
    compare_region_lists(result, optimal_clustering)
コード例 #2
0
def test_graph_dict_multi_attr():
    cluster_object = AZPReactiveTabu(max_iterations=max_it,
                                     k1=k1,
                                     k2=k2,
                                     random_state=0)
    cluster_object.fit_from_networkx(graph, double_attr_dict, n_regions=n_reg)
    result = region_list_from_array(cluster_object.labels_)
    compare_region_lists(result, optimal_clustering)
コード例 #3
0
def test_graph_dict_multi_attr():
    cluster_object = AZPReactiveTabu(max_iterations=max_it, k1=k1, k2=k2,
                                     random_state=0)
    cluster_object.fit_from_networkx(graph, double_attr_dict, n_regions=n_reg)
    result = region_list_from_array(cluster_object.labels_)
    compare_region_lists(result, optimal_clustering)