NiCE-MSI / nectar_msi

GNU Lesser General Public License v3.0
1 stars 1 forks source link

Error and troubleshoot about background masking. #3

Open ranabanik opened 5 months ago

ranabanik commented 5 months ago

"n_init should be > 0, got {self.n_init} instead."

The above error came due to cluster = KMeans(init="random", n_clusters=n_clusters, n_init="auto", max_iter=300).fit_predict(cube) in data_operations.py From _kmeans.py description,

n_init : int, default=10
Number of time the k-means algorithm will be run with different centroid seeds.

Also following the .ipynb in the /plotting folder, the background masking didn't work for the data I am using: intact protein MALDI-ToF. I got the following plot instead 6 tissue region masks. Any suggestions how to proceed?

image

NiCE-MSI commented 3 months ago

This issue has to do with the python package scikit-learn. A new version was released recently and maybe that’s the reason for this issue (version 1.4.1).

Recently they released another version (1.4.2). I updated the package to this latest version and could not reproduce the error with my data.

You can try to update to the latest version, or maybe a higher number of clusters is necessary for your dataset.