Giter Club home page Giter Club logo

Comments (5)

rockymadden avatar rockymadden commented on June 8, 2024

I'll dig into this a bit later today. Thanks for the submission!

from stringmetric.

rockymadden avatar rockymadden commented on June 8, 2024

There are a couple different ways to intersect/union sets. One, which you describe, is by exact position (like bitwise ops). The other, which Scala uses, is more loose. I've seen the algorithms both ways, but more often I see the loose version used:

http://www.planetcalc.com/1664/

Besides all that, there is a bug in the Jaccard algorithm that has been fixed: 6068b4b. It should have been:

intersection set length / (set1 length + set2 length - intersection set length)

I was missing the latter operator.

from stringmetric.

rockymadden avatar rockymadden commented on June 8, 2024

I could make a bitwise type jaccard, dice, etc. Would that be of interest?

from stringmetric.

diogomarques avatar diogomarques commented on June 8, 2024

It would be nice to have the more traditional similarity metrics for bit sequences. I believe that many similarity metrics were initially described as so. Although I must say that if you are focusing on strings (as sequences of alphanumeric letters), as the name "stringmetric" suggests, you're approach is probably more in line with what someone using your library might expect. I say "probably" because I don't actually know how these metrics are supposed to work in that case, namely what union, intersection, length and cardinality might mean.

In a previous response, which I'm now not seeing in this thread, you hinted at representing a binary sequence as a long and then make bitwise operations. I would just point out that if you do so, you are limiting the sequence length to the number of bits available in the internal representation of a long, which depends on, well, internals (e.g. the system's architecture). Java's BitSet overcomes this using an elastic array of long words, not without it's caveats. Or you could simply use a string of 0s and 1s - which one is more efficient is hard to tell.

from stringmetric.

rockymadden avatar rockymadden commented on June 8, 2024

Agreed on the alternate intersect/union implementation on these couple metrics.

You are spot on about the representation of the data structures. The original idea (which I did not detail) was to back the sets with longs and then perform bitwise operations, only should they be able to be represented properly. Else, bitset. However, I would still like to more than just bits to be used. There are some uses with strings and also with specific domain enumerations, like DNA.

from stringmetric.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.