From 21828944ad46f131acd53e9376be1c048569262d Mon Sep 17 00:00:00 2001 From: "Saigiridharan, Lakshidaa" Date: Tue, 23 Jan 2024 13:23:54 +0000 Subject: [PATCH] Rename deprecated keyword to --- route_distances/clustering.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)