Skip to content

Using old indicator events #286

@AgusPietra

Description

@AgusPietra

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions