Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNF: TypeError: spectral_clustering() takes 1 positional argument but 2 were given #105

Open
shivaprasad-patil opened this issue Jan 3, 2023 · 0 comments

Comments

@shivaprasad-patil
Copy link

Describe the bug
Hi, Thank you for the amazing package. I am trying to run Similarity Network Fusion Analysis from the example notebook https://ckg.readthedocs.io/en/latest/notebooks/reports/Meduloblastoma%20Data%20Analysis-SNF.html

When I run the following code
feature_df, fussed_aff, fused_labels, silhouette_score = analytics.run_snf(df_dict, index=['sample', 'group'], num_clusters=None, distance_metric='euclidean', k_affinity=5, mu_affinity=0.5)

I get an error TypeError: spectral_clustering() takes 1 positional argument but 2 were given

Expected behavior
I ran spectral clustering on an example array and it seems to work fine.

`import numpy as np
from sklearn.cluster import spectral_clustering
A = np.array([
[0, 1, 0, 0],
[1, 0, 1, 0],
[0, 1, 0, 1],
[0, 0, 1, 0],
])

labels = spectral_clustering(A, n_clusters=2)
print(labels)`

Desktop (please complete the following information):

  • OS: Mac Darwin-21.6.0-x86_64-i386-64bit

Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant