Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No error when trying to use native w/ Jaccard similarity #9

Open
joshdevins opened this issue Apr 2, 2012 · 4 comments
Open

No error when trying to use native w/ Jaccard similarity #9

joshdevins opened this issue Apr 2, 2012 · 4 comments

Comments

@joshdevins
Copy link

Turned native: true, and Recommendify would fail silently w/ Jaccard similarity instead of throwing some error when native extensions are failing. (if not built, I do get a proper error message: recommendify_native not found - you need to run rake build_native first)

Note that matrices are built but the final similarities hash in Redis is empty:

redis 127.0.0.1:6379[5]> hgetall recommendify:users:ccmatrix

  1. "989:992"
  2. "1"
  3. "989:994"
  4. "1"
  5. "992:994"
  6. "2"
  7. "990:992"
  8. "1"
  9. "990:994"
  10. "1"
  11. "991:993"
  12. "1"
  13. "991:994"
  14. "1"
  15. "993:994"
  16. "1"
    redis 127.0.0.1:6379[5]> hgetall recommendify:similarities
  17. "989"
  18. ""
  19. "992"
  20. ""
  21. "994"
  22. ""
  23. "990"
  24. ""
  25. "991"
  26. ""
  27. "993"
  28. ""

Some debug output added shows exit output as: item count is zero or one <-- this error should be thrown

Further debugging shows that unless you use DB 0 in Redis from Ruby, the native code will fail since it uses the default DB. Will open a new issue or fork for this.

@bloudermilk
Copy link

Getting this same error, unfortunately. Pure Ruby works fine, but native is failing silently. @joshdevins did you ever find a solution for this?

@joshdevins
Copy link
Author

@bloudermilk No, I ended up just using the pure Ruby version which is sufficient for our needs for now. I looked into fixing this and it wouldn't be difficult, but need to pass the DB number to the native worker. To debug, it's helpful to add some more log lines in the native worker and rebuild+retest. That's how I discovered my particular problem with selecting the non-default Redis DB.

@bloudermilk
Copy link

@joshdevins Thanks for the update. I'm actually using the default Redis DB ("0" I guess) and still having issues with the native worker. Is this what you experienced?

@paulasmuth Any plans to continue supporting this lib?

@joshdevins
Copy link
Author

@bloudermilk No, when I used the default Redis DB, there were no issues. Add some log lines in the native worker and you should see more details. Recompiling is simple from rake...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants