all_points_membership_vectors¶
- fast_plscan.prediction.all_points_membership_vectors(clusterer, labels=None)¶
Compute soft cluster membership vectors for all points.
- Parameters:
clusterer (
PLSCAN) – A fittedPLSCANinstance. Must have been fitted with feature-vector or (sparse) precomputed distance inputs.labels (
ndarray[tuple[int],dtype[int_]] |None, default:None) – An optional integer array of shape(n_samples,)with cluster labels for each point. WhenNone(default), the fittedlabels_are used.
- Return type:
- Returns:
membership_vectors – Float32 array of shape
(n_samples, n_clusters). Entry[i, c]is the soft membership of pointiin clusterc. Row sums equalprobability_in_some_cluster. When no clusters exist, returns shape(n_samples, 0).- Raises:
NotFittedError – If
clustererhas not been fitted yet.ValueError – If
clustererwas fitted with a precomputed minimum spanning forest.ValueError – If the shape of
labelsdoes not match the number of samples inclusterer.