The Measurable Gem

I updated the Measurable gem yesterday with documentation and corrections to the methods.

It’s a module packed with lots of methods that calculate the distance between two vectors, u and v. They’re pretty useful for machine learning tasks and can be used in various apps whenever you need to estimate the similarity of two things — strings, sets, etc.

Just a reminder that some of the methods aren’t metrics in the mathematical sense, that is, given a function d(x, y), it is a metric if and only if the following properties hold:

  • Symmetry: d(x, y) == d(y, x).
  • Non-negative: d(x, y) >= 0, for every (x, y).
  • Coincidence axiom: d(x, y) == 0 if, and only if, x == y.
  • Triangular inequality: d(x, y) <= d(x, z) + d(z, y).

In any case, there are still many methods that I want to add to Measurable (which you can find in the README). As I’m learning about them while I write this gem, it’s hard to know in advance what’s useful and what isn’t. Any help with references and examples (and feature requests) are appreciated.

Another point is that I want to rewrite some methods in C (e.g. Euclidean distance) to get to know Ruby’s C API and to speed some things up. This would be a pretty good reason to use the gem also — speed — as most of the methods are very straightforward and succint to write.

I plan on releasing versions 0.0.6 up to 0.1 very rapidly, just by adding new method definitions, updating documentation and probably adding some examples.

Well, that’s it.

Leave a Reply