xianglin226 / scMDC

Single Cell Multi-omics deep clustering
Apache License 2.0
24 stars 4 forks source link

Cluster label size #11

Open renjiaxu opened 9 months ago

renjiaxu commented 9 months ago

Hello, thank you very much for your work!

When I called the "best_map (L1, L2)" method in utils.py, I found that the clustering label size was larger than the groundtruth label, resulting in

  for i in range (nClass2):
        newL2 [L2==Label2 [i]]=Label1 [c [i]] 

statement cannot be executed properly.

The error message is as follows

Traceback (most recent call last):
 File "E:\python\workProject\scMDC\scMDC-master\src\run_scMDC.py", line 227, in <module>  y_pred_ = best_map(y, y_pred) - 1
 File "E:\python\workProject\scMDC\scMDC-master\src\utils.py", line 91, in best_map newL2[L2 == Label2[i]] = Label1[c[i]]
 IndexError: index 8 is out of bounds for axis 0 with size 6

Can you tell me where the problem is? Thank you

xianglin226 commented 9 months ago

Hi, thank you for pointing this problem out. In some special cases, the predicted cluster number (k) is lower than the defined k. If you really need the best map, could you try to adjust (such as increase) the defined K to produce more clusters?