Class RandomRecommender

java.lang.Object
org.localify.recommend.RandomRecommender
All Implemented Interfaces:
Recommender

public class RandomRecommender extends Object implements Recommender

A simple recommendation system implementing Recommender.

Picks local topArtists and randomly assigns a score to them.

This 'recommendation' system can be used as a defaultGeoDetails for actual implementations; this provides for resilience in case of a downstream system failure.

  • Constructor Details

    • RandomRecommender

      public RandomRecommender()
  • Method Details

    • doRecommend

      public List<RecSysArtistResponse> doRecommend(List<UUID> seeds, List<UUID> locals)

      Random recommendation implementation.

      Shuffles local topArtists, picks 25 of them, gives them a random score, and 3 random seed topArtists they are similar to.

      Specified by:
      doRecommend in interface Recommender
      Parameters:
      seeds - the seed topArtists
      locals - the local topArtists
      Returns:
      a collection of the recommendation responses - including the IDs and scores.
    • switchModel

      public void switchModel()
      Description copied from interface: Recommender
      Switches the model used by the recommender.
      Specified by:
      switchModel in interface Recommender
    • trainModel

      public void trainModel()
      Description copied from interface: Recommender
      Trains the recommender model.
      Specified by:
      trainModel in interface Recommender