Warum bekomme ich diesen Typeerror: agglomerativeclustering .__ init __ () hat ein unerwartetes Keyword -Argument "Affin

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Warum bekomme ich diesen Typeerror: agglomerativeclustering .__ init __ () hat ein unerwartetes Keyword -Argument "Affin

by Anonymous » 18 Apr 2025, 00:28

Hier ist mein Code: < /p>
from sklearn.cluster import FeatureAgglomeration
from sklearn.metrics import pairwise_distances

model = AgglomerativeClustering(n_clusters = 7 , linkage = "average" , affinity = "cosine" )
< /code>
...und hier ist der resultierende Fehler: < /p>
TypeError Traceback (most recent call last)
Cell In[17], line 4
1 from sklearn.cluster import FeatureAgglomeration
2 from sklearn.metrics import pairwise_distances
----> 4 model = AgglomerativeClustering(n_clusters = 7 , linkage = "average" , affinity = "cosine" )

TypeError: AgglomerativeClustering.__init__() got an unexpected keyword argument 'affinity'`
< /code>
Ich habe versucht, alle erforderlichen Bibliotheken zu aktualisieren und das PIP zu aktualisieren, aber immer noch nichts. Wie kann ich dieses Problem lösen?

Top