SergioFierens / ai4r

Artificial Intelligence for Ruby - A Ruby playground for AI researchers
http://ai4r.rubyforge.org
713 stars 124 forks source link

Adding the "cosine_distance" method to the "Ai4r::Data::Proximity" class #20

Closed vividness closed 11 years ago

vividness commented 11 years ago

Hey guys,

I've noticed that there was no cosine distance method inside the distance functions module. I'm not sure if you will need this but just in case if you want it.

I've been using the cosine distance function for my project and it's been working well. I've also created ai4r-ext in my repository which I'm planning to use in case I need to continue writing more extensions but I'd like better if I could contribute directly to the main codebase.

Cheers.

SergioFierens commented 11 years ago

Hi,

Thanks for the contribution! I just merged it.

Cheers, Sergio

SergioFierens commented 11 years ago

Actually, just as a comment, I had to fix it because it seems "cosine similarity" was implemented, rather than "cosine distance". No biggie, I just changed the function to return (1 - similarity).

Cheers, Sergio

vividness commented 10 years ago

Hey Sergio, you're very welcome!

I'm glad to help. Let me know if you guys have anything else you're planning to implement - I can take some of that workload too!

Thanks.