Closed vikram223 closed 1 month ago
Hello, This might be due to the IDE. Could you please try the same code outside the IDE (directly in Python)? Thanks.
It will take me too long to build an environment with pandas etc outside of Anaconda. I tested it without the Spyder IDE though and it still fails. I tested it under my WSL (Windows subsystem linux) anaconda ennvironment with python 3.9.19 and it works there. Unsure if the issue is the Windows env or the Python version.
(base) C:\.....\....\....>python
Python 3.11.9 | packaged by Anaconda, Inc. | (main, Apr 19 2024, 16:40:41) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from sknetwork.clustering import Louvain
>>> from sknetwork.data import karate_club
>>> louvain = Louvain()
>>> adjacency = karate_club()
File "<stdin>", line 1
adjacency = karate_club()
IndentationError: unexpected indent
>>> adjacency = karate_club()
>>> labels = louvain.fit_predict(adjacency)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\ProgramData\anaconda3\Lib\site-packages\sknetwork\clustering\base.py", line 64, in fit_predict
self.fit(*args, **kwargs)
File "C:\ProgramData\anaconda3\Lib\site-packages\sknetwork\clustering\louvain.py", line 276, in fit
labels, increase = self._optimize(labels, adjacency, out_weights, in_weights)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\Lib\site-packages\sknetwork\clustering\louvain.py", line 144, in _optimize
return optimize_core(labels, indices, indptr, data, out_weights, in_weights, out_cluster_weights,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "sknetwork\\clustering\\louvain_core.pyx", line 10, in sknetwork.clustering.louvain_core.__pyx_fused_cpdef
TypeError: No matching signature found
>>>
Hello, I am closing this issue as it seems related to your environment. Thanks.
Description
Tried to use Louvain() function on an adjacency matrix. It failed. Tried it on the karate_club() data and it still failed. So the example code in the scikit-network docs didn't work for me
IDE and running environment Anaconda with spyder conda 24.7.1
What I Did
Below is the traceback error