cNMF
cNMF copied to clipboard
Skip clustering if k > n_topics
I get a ValueError
if the number of topics after density filtering is less than the number of desired components.
Traceback (most recent call last):
File "/Users/scottgigante/envs/immunaISR/lib/python3.8/site-packages/cnmf/cnmf.py", line 727, in consensus
kmeans_model.fit(l2_spectra)
File "/Users/scottgigante/envs/immunaISR/lib/python3.8/site-packages/sklearn/cluster/_kmeans.py", line 1426, in fit
self._check_params_vs_input(X)
File "/Users/scottgigante/envs/immunaISR/lib/python3.8/site-packages/sklearn/cluster/_kmeans.py", line 1362, in _check_params_vs_input
super()._check_params_vs_input(X, default_n_init=10)
File "/Users/scottgigante/envs/immunaISR/lib/python3.8/site-packages/sklearn/cluster/_kmeans.py", line 859, in _check_params_vs_input
raise ValueError(
ValueError: n_samples=19 should be >= n_clusters=41.
This PR solves that issue.
@dylkot would you please take a look and consider merging this PR?