API Usage

gausss edited this page Oct 1, 2014 · 3 revisions
Clone this wiki locally

What for?

The API allows you to add recommender algorithms without touching the internal system.

How to?

Download the API & Add it to your project. Take a look at the included example recommender class to get a better understanding of the following explanations.

To write a recommender algorithm extend the AbstractRecommender class. This way you will have to implement 4 functions.

  • getName

    State the name of the recommender. This will be displayed in the settings of the web application.

  • getExplanation

    Give a short explanation of how the recommender algorithm works. This will be displayed in the settings of the web application. Mustn't be more than 3 sentences.

  • getTagDistribution

    Recommender algorithms are usually characterized by Accuracy, Novelty, Diversity and Serendipity. Specify the distribution of the characteristics in percent. This must of course add up to 100% and shouldn't include less or more characteristics than the ones given above.

  • getRecommendations(User user, int howMany)

    This is where the actual recommender algorithm goes.

    The given number of recommendations are to be created for the given user. The user object will provide the user's demographic information. In addition the AbstractRecommender exposes a so called data repository. The repository can access data on the system the recommender is deployed on in the end. You can access information like available songs, song details, user ratings, ... which will help in building the recommender algorithm.

    For offline testing purposes a TestRepository class is included in the API, which can be passed to any recommender objet, to test the algorithm with sample data.

    Your algorithm has to take care of returning the correct number of recommendations while avoiding duplicates.

The finished recommender can be plugged into the running system via the web application. Export as jar file and navigate to the configuration site in the admin area of the application.