lazyslide.metrics.topk#
Functions
|
Get the top k score from a feature x class matrix. |
- topk_score(matrix, k=5, agg_method='max')#
Get the top k score from a feature x class matrix.
- Parameters:
- matrixnp.ndarray | AnnData
The input matrix. Feature x class.
- kint, default: 5
The number of top scores to return.
- agg_methodstr, default: “max”
The method to use for aggregation. Can be “max”, “mean”, “median” or “sum”.
- Returns:
- np.ndarray
The top k scores.