[libcamera-devel] [PATCH 1/3] utils: raspberrypi: ctt: Fix namespace for sklearn NearestCentroid function

David Plowman david.plowman at raspberrypi.com
Wed Jul 28 10:27:49 CEST 2021


Hi Kieran

I did go looking for the version when this changed, but even trawling
through the release notes didn't really enlighten me. I found a commit
here (https://github.com/scikit-learn/scikit-learn/commit/62aee0666e8803f20ecf0f6214621367e50f3961#diff-9f63dcf8f128db106a66cc33db9816f91db51e286f5f13af3f87405468b3df2b)
that clearly has some bearing on this, from back in October 2019, but
there doesn't seem to be anything older there. So unless anyone else
can enlighten me, I've thrown in the towel... :(

Thanks anyway!
David

On Mon, 26 Jul 2021 at 11:31, Kieran Bingham
<kieran.bingham at ideasonboard.com> wrote:
>
> Hi David,
>
> On 21/07/2021 12:52, David Plowman wrote:
> > The NearestCentroid function is now in the sklearn.neighbors
> > namespace.
> >
>
> Does this have requirements of a specific version of the external
> import? It would probably be helpful to mention the version that it
> became required or ensure that the newest version is now a required
> version somehow.
>
> But otherwise,
>
> Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
>
> > Signed-off-by: David Plowman <david.plowman at raspberrypi.com>
> > ---
> >  utils/raspberrypi/ctt/ctt_tools.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > 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
> >


More information about the libcamera-devel mailing list