diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2021-04-15 21:25:03 +0200 |
---|---|---|
committer | Marc Glisse <marc.glisse@inria.fr> | 2021-04-15 21:25:03 +0200 |
commit | 2ce8b315fe5e069d6444b79f6b01e76327fa5d1d (patch) | |
tree | cd10514d2a41eee525b200b63a4e277f999c58a4 | |
parent | 7e05e915adc1be285e04eb00d3ab7ba1b797f38d (diff) |
Name the argument n_neighbors of NearestNeighbors
It seems that it has had the same name for a while, so this shouldn't
break anything.
sklearn/utils/validation.py:70: FutureWarning: Pass n_neighbors=3 as keyword args. From version 1.0 (renaming of 0.25) passing these as positional arguments will result in an error
-rw-r--r-- | src/python/gudhi/point_cloud/knn.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/python/gudhi/point_cloud/knn.py b/src/python/gudhi/point_cloud/knn.py index 994be3b6..829bf1bf 100644 --- a/src/python/gudhi/point_cloud/knn.py +++ b/src/python/gudhi/point_cloud/knn.py @@ -111,7 +111,7 @@ class KNearestNeighbors: nargs = { k: v for k, v in self.params.items() if k in {"p", "n_jobs", "metric_params", "algorithm", "leaf_size"} } - self.nn = NearestNeighbors(self.k, metric=self.metric, **nargs) + self.nn = NearestNeighbors(n_neighbors=self.k, metric=self.metric, **nargs) self.nn.fit(X) if self.params["implementation"] == "hnsw": |