jubatus/jubatus — pull request #142 by unnonouno (2012-10-23 16:02:04+00:00)
Title: Feature/fix global weight

I fixed global-weight bug #124. And, #94 is also fixed. Main difference is below:

- `weight_manager` is shared in `xxx_serv` and `datum_to_fv_converter` using shared pointer. Document frequencies are correctly mixed.
- `datum_to_fv_converter` has two conversion methods now. One is `convert`. This const method is only for converting datum, and it dose not change weight information. We can call it in read lock. Another is `convert_and_update_weight`. It converts datum and update weight information. We can only call it in write lock.
- Add `mixable_weight_manager` to `recommender_serv`, and the recommender correctly use global weight. I wrote test for it in `recommender_serv_test`.
- IDF is defined as log((document_count + 1) / (df + 1)) to avoid NaN. c20b21728fa20278843849b68daf66cbd933fbab