diff --git a/route_distances/clustering.py b/route_distances/clustering.py index 4f37eaa..f41e63c 100644 --- a/route_distances/clustering.py +++ b/route_distances/clustering.py @@ -41,7 +41,7 @@ def fixed_clustering(self, n_clusters: int, **kwargs: Any) -> np.ndarray: """ if "linkage" not in kwargs: kwargs["linkage"] = "single" - kwargs["affinity"] = "precomputed" + kwargs["metric"] = "precomputed" kwargs["n_clusters"] = n_clusters model = AgglomerativeClustering(**kwargs) model.fit(self._distances) @@ -59,7 +59,7 @@ def linkage_matrix(self, **kwargs: Any) -> np.ndarray: """ if "linkage" not in kwargs: kwargs["linkage"] = "single" - kwargs["affinity"] = "precomputed" + kwargs["metric"] = "precomputed" kwargs["n_clusters"] = None kwargs["distance_threshold"] = 0.0 model = AgglomerativeClustering(**kwargs)