Skip to content

Commit 543c059

Browse files
committed
Force idxmax result to be non-categorical #96
1 parent 77abaa3 commit 543c059

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

celltypist/classifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def majority_vote(predictions: AnnotationResult, over_clustering: Union[list, tu
468468
over_clustering = np.array(over_clustering)
469469
logger.info("🗳️ Majority voting the predictions")
470470
votes = pd.crosstab(predictions.predicted_labels['predicted_labels'], over_clustering)
471-
majority = votes.idxmax(axis=0)
471+
majority = votes.idxmax(axis=0).astype(str)
472472
freqs = (votes / votes.sum(axis=0).values).max(axis=0)
473473
majority[freqs < min_prop] = 'Heterogeneous'
474474
majority = majority[over_clustering].reset_index()

0 commit comments

Comments
 (0)