-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Description
Recommendations for user are based only on the oldest maxIndicatorsPerQuery events of an indicator, not the newest.
Details:
This is the specific part of the code that I think has the problem:
.groupBy(_.event)
.flatMap { case (name, events) =>
events.sortBy(_.eventTime) // implicit ordering
.take(indicatorsMap(name)
.maxIndicatorsPerQuery.getOrElse(DefaultURAlgoParams.MaxQueryEvents))
}.toSeq
I propose to change it to:
.groupBy(_.event)
.flatMap { case (name, events) =>
events.sortBy(_.eventTime).reverse // implicit ordering
.take(indicatorsMap(name)
.maxIndicatorsPerQuery.getOrElse(DefaultURAlgoParams.MaxQueryEvents))
}.toSeq
The sort by is ordering in ascending order, I'm actually debugging the code and watching this behavior.
Sorry to open another issue with this, I think the oter issue I opened wasn't clear enough, so you misunderstand me.
Thanks for reading