grassp.tl.silhouette_score#
- silhouette_score(data, gt_col, use_rep='X_umap', key_added='silhouette', inplace=True)[source]#
Calculate silhouette scores for clustered data.
- Parameters:
- data AnnData
Annotated data matrix.
- gt_col str
Column name in data.obs containing cluster labels.
- use_rep str, optional
Key for representation in data.obsm to use for score calculation. Defaults to ‘X_umap’.
- key_added str, optional
Key under which to add the silhouette scores. Defaults to ‘silhouette’.
- inplace bool, optional
If True, store results in data, else return scores. Defaults to True.
- Return type:
None
|ndarray
- Returns:
None or ndarray If inplace=True, returns None and stores results in data. If inplace=False, returns array of silhouette scores.