cugraph.analyzeClustering_edge_cut#

cugraph.analyzeClustering_edge_cut(G, n_clusters, clustering, vertex_col_name='vertex', cluster_col_name='cluster')[source]#

Compute the edge cut score for a partitioning/clustering The assumption is that “clustering” is the results from a call from a special clustering algorithm and contains columns named “vertex” and “cluster”.

Parameters:
Gcugraph.Graph

cuGraph graph descriptor

n_clustersinteger

Specifies the number of clusters in the given clustering

clusteringcudf.DataFrame

The cluster assignment to analyze.

vertex_col_namestr, optional (default=’vertex’)

The name of the column in the clustering dataframe identifying the external vertex id

cluster_col_namestr, optional (default=’cluster’)

The name of the column in the clustering dataframe identifying the cluster id

Returns:
scorefloat

The computed edge cut score

Examples

>>> from cugraph.datasets import karate
>>> G = karate.get_graph(download=True)
>>> df = cugraph.spectralBalancedCutClustering(G, 5)
>>> score = cugraph.analyzeClustering_edge_cut(G, 5, df)