API

clustergraph.ConnectivityPruning module

clustergraph.EdgeStrategy module

clustergraph.GraphPruning module

clustergraph.Metric_distortion_class module

clustergraph.NodeStrategy module

clustergraph.c_GraphPreprocess module

clustergraph.clustergraph module

clustergraph.distances module

clustergraph.plot_graph module

clustergraph.subsampling module

clustergraph.utils module

clustergraph.utils.get_clusters_from_BM(bm)

_summary_ From a BallMapper object returns a list of clusters with each cluster being a list of indices corresponding to the points covered :param bm: :type bm: BallMapper

Returns:

Returns a list of clusters. Each element of the list is also a list in which all indices of the points coverd by this cluster are stored.

Return type:

list

clustergraph.utils.get_clusters_from_Mapper(graph)

_summary_ From a Mapper object returns a list of clusters with each cluster being a list of indices corresponding to the points covered :param graph:

Returns:

Returns a list of clusters. Each element of the list is also a list in which all indices of the points coverd by this cluster are stored.

Return type:

list

clustergraph.utils.get_clusters_from_scikit(prediction, return_mapping=False)

_summary_ From a list of prediction returns a list of clusters with each cluster being a list of indices :param prediction: Cluster labels. At each index there is a label corresponding to the cluster of the data point. :type prediction: list or numpy array

Returns:

Returns a list of clusters. Each element of the list is numpy array in which all indices of the points coverd by this cluster are stored.

Return type:

list

clustergraph.utils.get_corresponding_edges(vertices, edges)

_summary_

Parameters:
  • vertices

  • edges

clustergraph.utils.get_sorted_edges(graph, variable_length='label')

_summary_

Parameters:
  • graph

  • variable_length (str, optional) – , by default “label”

clustergraph.utils.get_values(list_key_value)

_summary_

Parameters:

list_key_value

Raises:

ValueError

clustergraph.utils.insert_sorted_list(liste, element_to_insert)

Function which inserts in a ordered list a new element. Each element has this form [keys_1, keys_2, value] and we order depending of on the ‘value’ element. Returns the ordered list with the new element

Parameters:
  • liste (list) – list of element each element is represented by a list [keys_1, keys_2, value], the list is already ordered based on the ‘value’

  • element_to_insert (list) – list as followed [keys_1, keys_2, value] that we want to insert in the list by keeping it ordered

Returns:

Returns the ordered list with the new element

Return type:

list

clustergraph.utils.max_size_node_graph(graph, variable, nodes=None)

_summary_

Parameters:
  • graph

  • variable

  • nodes (, optional) – , by default None

clustergraph.utils.replace_in_array(list_1, list_2, arr, val)

Function which in a numpy darray replace the crossing positions values for the lines list_1 and columns list_2 and inverse (symetric change) , by the value wanted

Parameters:
  • list_1 (list or numpy.array) – the rows in which we want to change the value

  • list_2 (list or numpy.array) – the columns in which we want to change the value

  • arr (numpy.darray) – the darray that we want to modify

  • val (float or int) – the value we want to be in those positions

Returns:

The darray modified

Return type:

numpy.darray