diff --git a/celltypist/classifier.py b/celltypist/classifier.py index 2e353dc..1f43ada 100644 --- a/celltypist/classifier.py +++ b/celltypist/classifier.py @@ -468,7 +468,7 @@ def majority_vote(predictions: AnnotationResult, over_clustering: Union[list, tu over_clustering = np.array(over_clustering) logger.info("🗳️ Majority voting the predictions") votes = pd.crosstab(predictions.predicted_labels['predicted_labels'], over_clustering) - majority = votes.idxmax(axis=0) + majority = votes.idxmax(axis=0).astype(str) freqs = (votes / votes.sum(axis=0).values).max(axis=0) majority[freqs < min_prop] = 'Heterogeneous' majority = majority[over_clustering].reset_index()