When utility.init_clustering is called with initial_clustering_method == "User" assumes that the user supplied clusters in labels are consecutive integers, which then breaks at
init_e[c, :] = adata.X[init_l == c].mean(0)
if e.g. init_l is a string.
The solution isn't as simple as casting labels to an int as no guarantee labels are either integers or consecutive.
When
utility.init_clustering
is called withinitial_clustering_method == "User"
assumes that the user supplied clusters inlabels
are consecutive integers, which then breaks atinit_e[c, :] = adata.X[init_l == c].mean(0)
if e.g.
init_l
is a string.The solution isn't as simple as casting
labels
to anint
as no guarantee labels are either integers or consecutive.Would recommend something like
then doing