jubatus / jubatus_core

Jubatus algorithm component
GNU Lesser General Public License v2.1
20 stars 29 forks source link

Fix cosine similarity calculation floating-point error #356

Closed shiodat closed 7 years ago

shiodat commented 7 years ago

This PR fixes #355.

kazuki commented 7 years ago

L391 is called many times (worst case, a number of all rows ?). If inserting min/max call before scores.push_back, min/max is called constant times and returns approximately same result.

shiodat commented 7 years ago

@kazuki Thank you for your review. I fix the min/max to be called only constant times.

yukimori commented 7 years ago

I confirm this PR fixes #355 and there is no syntax error by cpplint.