cugraph.analyzeClustering_ratio_cut#

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

Compute the ratio cut score for a partitioning/clustering

Parameters:
Gcugraph.Graph

cuGraph graph descriptor. This graph should have edge weights.

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 ratio cut score

Examples

>>> from cugraph.datasets import karate
>>> G = karate.get_graph(download=True)
>>> df = cugraph.spectralBalancedCutClustering(G, 5)
>>> score = cugraph.analyzeClustering_ratio_cut(G, 5, df, 'vertex',
...                                             'cluster')