Ejemplo n.º 1
0
def test_graph_dict_basic():
    cluster_object = AZPSimulatedAnnealing(init_temperature=1,
                                           max_iterations=2,
                                           random_state=0)
    cluster_object.fit_from_networkx(graph, attr_dict, n_regions=2)
    result = region_list_from_array(cluster_object.labels_)
    compare_region_lists(result, optimal_clustering)
def test_graph_dict_basic():
    cluster_object = AZPSimulatedAnnealing(init_temperature=1,
                                           max_iterations=2,
                                           random_state=0)
    cluster_object.fit_from_networkx(graph, attr_dict, n_regions=2)
    result = region_list_from_array(cluster_object.labels_)
    compare_region_lists(result, optimal_clustering)
Ejemplo n.º 3
0
def test_graph_str_multi_attr():
    nx.set_node_attributes(graph, attr_dict, attr_str)
    cluster_object = AZPSimulatedAnnealing(init_temperature=1,
                                           max_iterations=2,
                                           random_state=0)
    cluster_object.fit_from_networkx(graph, double_attr_str, n_regions=2)
    result = region_list_from_array(cluster_object.labels_)
    compare_region_lists(result, optimal_clustering)
def test_graph_str_multi_attr():
    nx.set_node_attributes(graph, attr_str, attr_dict)
    cluster_object = AZPSimulatedAnnealing(init_temperature=1,
                                           max_iterations=2,
                                           random_state=0)
    cluster_object.fit_from_networkx(graph, double_attr_str, n_regions=2)
    result = region_list_from_array(cluster_object.labels_)
    compare_region_lists(result, optimal_clustering)