From a792512496abbf756354cecc7b564e9733ea3fda Mon Sep 17 00:00:00 2001 From: David Plowman Date: Wed, 21 Jul 2021 12:52:18 +0100 Subject: utils: raspberrypi: ctt: Fix namespace for sklearn NearestCentroid function Starting in version 0.22, the NearestCentroid function is only available in the sklearn.neighbors namespace, when it was previously available in both the sklearn.neighbors.nearest_centroid and sklearn.neighbors namespaces. Use sklearn.neighbors as it works on all versions of sklearn. Signed-off-by: David Plowman Reviewed-by: Naushir Patuck Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- utils/raspberrypi/ctt/ctt_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils') diff --git a/utils/raspberrypi/ctt/ctt_tools.py b/utils/raspberrypi/ctt/ctt_tools.py index 48e0aac2..8728ff16 100644 --- a/utils/raspberrypi/ctt/ctt_tools.py +++ b/utils/raspberrypi/ctt/ctt_tools.py @@ -14,7 +14,7 @@ import imutils import sys import matplotlib.pyplot as plt from sklearn import cluster as cluster -from sklearn.neighbors.nearest_centroid import NearestCentroid as get_centroids +from sklearn.neighbors import NearestCentroid as get_centroids """ This file contains some useful tools, the details of which aren't important to -- cgit v1.2.1