"Fuzzy" Counter?

Peter Otten __peter__ at web.de
Tue Sep 23 09:36:24 EDT 2014


Miki Tebeka wrote:

> Before I start writing my own. Is there something like collections.Counter
> (fore frequencies) that does "fuzzy" matching?
> 
> Meaning x is considered equal to y if abs(x - y) < epsilon. (x, y and my
> case will be numpy.array).

The problem I see with that description is that for x, y, z, assumming 

x eq y 
y eq z
not (x eq z)

where eq is the test given above -- should x, y, and z land in the same bin?

I'm not really qualified here, but k-means clustering may be a direction to 
investigate:

<http://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.vq.kmeans.html>




More information about the Python-list mailing list