sunandap / airhead-research

Automatically exported from code.google.com/p/airhead-research
0 stars 0 forks source link

Magnitude in DenseVector not set correctly in DenseVector(double[] v) constructor #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The magnitude in the DenseVector(double[] v) constructor is set to 0, which 
means it never gets recomputed.  It should be set to -1.  I noticed this when 
trying to cluster the document from an LSA run using cosine similarity.

I you want, I'd be happy to commit fixes as I run into bugs. 

Original issue reported on code.google.com by jintrone@gmail.com on 18 Dec 2010 at 4:28

GoogleCodeExporter commented 9 years ago
You are quite right! It should be -1.  I've just committed a fix, and a test to 
catch this case in the future.  Thanks for pointing this out!

Just out of curiosity, Were you creating vectors with this constructor and 
never modifying the values?  I find it odd that we've never run into this issue 
before, but i suspect it's because we almost never use that constructor.

Original comment by FozzietheBeat@gmail.com on 18 Dec 2010 at 5:53