You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found two bugs in Serenade, which lead to reproducibility issue, where the recommender system returns different results when executed with the same inputs. Both are caused by a lack of tie breaking during sorting or top-k aggregation.
The first issue is in https://github.com/bolcom/serenade/blob/main/src/io.rs#L48 which loads test sessions from a CSV file. Here the session entries are sorted by timestamp. The code does not handle cases where several entries have the same timestamp and puts such entries in random order across different executions. A fix is for example to sort by item id in addition for equal timestamps.
The second issue is in https://github.com/bolcom/serenade/blob/main/src/vmisknn/vmis_index.rs#L395 . This code iterates over the session similarities which are stored in a hash map and extracts the top-k entries via a heap. The iteration order over a hashmap is not defined and changes in a non-deterministic way during repeated executions for the same data. If several sessions with the same score are present, there can be case where the selection which of them to put into the top-k entries of the heap changes non-deterministically as well (as it depends on the iteration order). A fix here is to for example sort the keys before iterating.
The text was updated successfully, but these errors were encountered:
I found two bugs in Serenade, which lead to reproducibility issue, where the recommender system returns different results when executed with the same inputs. Both are caused by a lack of tie breaking during sorting or top-k aggregation.
The first issue is in https://github.com/bolcom/serenade/blob/main/src/io.rs#L48 which loads test sessions from a CSV file. Here the session entries are sorted by timestamp. The code does not handle cases where several entries have the same timestamp and puts such entries in random order across different executions. A fix is for example to sort by item id in addition for equal timestamps.
The second issue is in https://github.com/bolcom/serenade/blob/main/src/vmisknn/vmis_index.rs#L395 . This code iterates over the session similarities which are stored in a hash map and extracts the top-k entries via a heap. The iteration order over a hashmap is not defined and changes in a non-deterministic way during repeated executions for the same data. If several sessions with the same score are present, there can be case where the selection which of them to put into the top-k entries of the heap changes non-deterministically as well (as it depends on the iteration order). A fix here is to for example sort the keys before iterating.
The text was updated successfully, but these errors were encountered: