(1) Is there a reason you formed the Lr norm to only accept integer values for r? and why isn’t there a check for r>1? As when: 0 < r =1 (i.e. a double instead of an int)

(2) In the final step of the norm, you *may* way to include a simple test to see if the norm is 0 before applying the expensive Math.pow function

(3) For the Cosine Class

(3.1) When I implement, I generally will test to see if there is any non-zero common indexes. If not, the IP = 0 –> COS (theta) = 0 –> 0 = Pi/2. Depending on the implementation, this can speed things up

(3.2) When you computed the final Cos value, should you not do a check on the l1norm and l2norm to see they are both non-zero. This alternatively could be done at the start to check to see if either are the zero vectors.

Really enjoyed reading this page (came about from a random google search). I look forward to reading more of your stuff.

Lastly, have you considered implementations that take the Frequency Distributions, convert them to Discrete Probability Measures and then implement Statistical Distance Measures? this is quite common in the IR / NLP literature.

]]>