Package org.localify.recommend
Class RandomRecommender
java.lang.Object
org.localify.recommend.RandomRecommender
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoRecommend(List<UUID> seeds, List<UUID> locals) Random recommendation implementation.voidSwitches the model used by the recommender.voidTrains the recommender model.
-
Constructor Details
-
RandomRecommender
public RandomRecommender()
-
-
Method Details
-
doRecommend
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:
doRecommendin interfaceRecommender- Parameters:
seeds- the seed topArtistslocals- the local topArtists- Returns:
- a collection of the recommendation responses - including the IDs and scores.
-
switchModel
public void switchModel()Description copied from interface:RecommenderSwitches the model used by the recommender.- Specified by:
switchModelin interfaceRecommender
-
trainModel
public void trainModel()Description copied from interface:RecommenderTrains the recommender model.- Specified by:
trainModelin interfaceRecommender
-