Skip to content

Commit

Permalink
🔧 update value counts for predictions, fix bowang-lab#135
Browse files Browse the repository at this point in the history
  • Loading branch information
subercui committed Dec 12, 2023
1 parent ab566c7 commit e881fd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tutorials/Tutorial_Reference_Mapping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@
" idx = labels[k]\n",
" else:\n",
" idx, sim = get_similar_vectors(test_emebd[k][np.newaxis, ...], ref_cell_embeddings, k)\n",
" pred = mode(ref_embed_adata.obs[cell_type_key][idx], axis=0)\n",
" preds.append(pred[0][0])\n",
" pred = ref_embed_adata.obs[cell_type_key][idx].value_counts()\n",
" preds.append(pred.index[0])\n",
"gt = test_adata.obs[cell_type_key].to_numpy()\n",
"\n",
"sklearn.metrics.accuracy_score(gt, preds)"
Expand Down

0 comments on commit e881fd9

Please sign in to comment.