v_measure_score#
- cuml.metrics.cluster.v_measure_score(labels_true, labels_pred, beta=1.0) float[source]#
cython_v_measure(labels_true, labels_pred, beta=1.0) -> float
V-measure metric of a cluster labeling given a ground truth.
The V-measure is the harmonic mean between homogeneity and completeness:
v = (1 + beta) * homogeneity * completeness / (beta * homogeneity + completeness)
This metric is independent of the absolute values of the labels: a permutation of the class or cluster label values won’t change the score value in any way.
This metric is furthermore symmetric: switching
label_truewithlabel_predwill return the same score value. This can be useful to measure the agreement of two independent label assignments strategies on the same dataset when the real ground truth is not known.- Parameters:
- labels_predarray-like (device or host) shape = (n_samples,)
The labels predicted by the model for the test dataset. Acceptable formats: cuDF DataFrame, NumPy ndarray, Numba device ndarray, cuda array interface compliant array like CuPy
- labels_truearray-like (device or host) shape = (n_samples,)
The ground truth labels (ints) of the test dataset. Acceptable formats: cuDF DataFrame, NumPy ndarray, Numba device ndarray, cuda array interface compliant array like CuPy
- betafloat, default=1.0
Ratio of weight attributed to
homogeneityvscompleteness. Ifbetais greater than 1,completenessis weighted more strongly in the calculation. Ifbetais less than 1,homogeneityis weighted more strongly.
- Returns:
- v_measure_valuefloat
score between 0.0 and 1.0. 1.0 stands for perfectly complete labeling