Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78384

Re: "Fuzzy" Counter?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ethan@stoneleaf.us>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.025
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'transform': 0.07; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'pep': 0.09; '~ethan~': 0.09; '(x,': 0.16; '[1].': 0.16; 'url:peps': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; '(such': 0.24; 'own.': 0.24; 'url:dev': 0.24; 'decide': 0.24; 'header:In-Reply-To:1': 0.27; '[1]': 0.29; 'am,': 0.29; 'closer': 0.31; 'keys': 0.31; 'sep': 0.31; 'yourself.': 0.31; 'probably': 0.32; 'url:python': 0.33; 'something': 0.35; 'definition': 0.35; 'equal': 0.35; 'there': 0.35; 'method': 0.36; 'charset:us-ascii': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'should': 0.36; 'to:addr :python-list': 0.38; 'does': 0.39; 'subject:" ': 0.39; 'to:addr:python.org': 0.39; 'is.': 0.60; 'received:173': 0.61; "you're": 0.61; "you'll": 0.62; 'skip:n 10': 0.64; 'taking': 0.65; 'floor,': 0.68; '(pdt)': 0.91; 'that),': 0.91
Date Fri, 26 Sep 2014 09:20:12 -0700
From Ethan Furman <ethan@stoneleaf.us>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1
MIME-Version 1.0
To python-list@python.org
Subject Re: "Fuzzy" Counter?
References <0d28ee82-2240-4f10-9db9-e966c0e62a13@googlegroups.com> <20140923093244.066bb10b@rg.highlandtechnology.com>
In-Reply-To <20140923093244.066bb10b@rg.highlandtechnology.com>
Content-Type text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.14399.1411748416.18130.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1411748416 news.xs4all.nl 2919 [2001:888:2000:d::a6]:43303
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:78384

Show key headers only | View raw


On 09/23/2014 09:32 AM, Rob Gaddi wrote:
> On Tue, 23 Sep 2014 05:34:19 -0700 (PDT) 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).
>
> You'll probably have to write that yourself.  While you're at it, think
> long and hard about that definition of fuzziness.  If you can make it
> closer to the concept of histogram "bins" you'll get much better
> performance.

You might want to take a look at the reference implementation for PEP 455 [1].  If you can decide on a method to 
transform your keys (such as taking the floor, or the half, or something like that), then that should work as is.

--
~Ethan~


[1] http://legacy.python.org/dev/peps/pep-0455/

Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

"Fuzzy" Counter? Miki Tebeka <miki.tebeka@gmail.com> - 2014-09-23 05:34 -0700
  Re: "Fuzzy" Counter? Peter Otten <__peter__@web.de> - 2014-09-23 15:36 +0200
    Re: "Fuzzy" Counter? Miki Tebeka <miki.tebeka@gmail.com> - 2014-09-23 21:57 -0700
      Re: "Fuzzy" Counter? random832@fastmail.us - 2014-09-26 13:57 -0400
  Re: "Fuzzy" Counter? Tim Chase <python.list@tim.thechases.com> - 2014-09-23 08:42 -0500
  Re: "Fuzzy" Counter? Rob Gaddi <rgaddi@technologyhighland.invalid> - 2014-09-23 09:32 -0700
    Re: "Fuzzy" Counter? Chris Angelico <rosuav@gmail.com> - 2014-09-24 02:41 +1000
    Re: "Fuzzy" Counter? Miki Tebeka <miki.tebeka@gmail.com> - 2014-09-23 22:01 -0700
      Re: "Fuzzy" Counter? Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-24 08:56 -0600
        Re: "Fuzzy" Counter? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-26 16:45 +1000
        Re: "Fuzzy" Counter? Miki Tebeka <miki.tebeka@gmail.com> - 2014-09-26 01:23 -0700
      Re: "Fuzzy" Counter? Rob Gaddi <rgaddi@technologyhighland.invalid> - 2014-09-26 11:30 -0700
        Re: "Fuzzy" Counter? random832@fastmail.us - 2014-09-26 15:10 -0400
          Re: "Fuzzy" Counter? Rob Gaddi <rgaddi@technologyhighland.invalid> - 2014-09-26 12:36 -0700
    Re: "Fuzzy" Counter? Ethan Furman <ethan@stoneleaf.us> - 2014-09-26 09:20 -0700

csiph-web