Skip to content
A client-side recommender system implemented in Javascript.
Java JavaScript
Latest commit 02ddc40 Apr 9, 2015 @jcnewell jcnewell Update README.md
Failed to load latest commit information.
engine Removed dependency on JQuery Mar 12, 2014
lib Initial commit. May 17, 2013
src Added example training app for collaborative filtering May 29, 2013
AUTHORS Initial commit. May 17, 2013
COPYING Apache 2.0 license Oct 18, 2013
README.md Update README.md Apr 9, 2015

README.md

clientside-recommender

A client-side recommender system implemented in Javascript. It uses the Weighted Item kNN algorithm, as implemented in the MyMediaLite Recommender System Framework which can be used to train the required kNN model.

For the theoretical backgound see "Item-based nearest neighbor recommendation" in:

Recommender Systems: An Introduction
Dietmar Jannach, Markus Zanker, Alexander Felfernig, Gerhard Friedrich
ISBN: 9780521493369
Pages: 18 - 20

An example application is available here:

To use the engine you must to load two JavaScript files - one containing the engine, the other containing the recommender model.

Recommender engine

The engine implements pre-filtering, prediction, ranking and post-filtering.

It provides two methods:

1) Get an ordered list of all items

Receng.getChoices(genre, type, likes, dislikes)

You set the order of this list when you build the model. For example it could be in order of popularity (i.e. non-personalised recommendations)

2) Get an ordered list of recommendations based on the user's likes and dislikes

Receng.getRecs(genre, type, likes, dislikes)

Parameters for both methods:

type is "all" (or null or undefined) or a string representing the required media type e.g. "0" for audio or "1" for video.

genre is "all" (or null or undefined) or a string representing the required content genre e.g. "0" for comedy or "1" for drama etc.

likes and dislikes are arrays of item IDs which the user likes or dislikes. If null or undefined they are ignored. In the getChoices method these IDs are simply blacklists (they remove the items from the results). In the getRecs method they are used to personalize the results - if no likes or dislikes are provided getRecs returns the same list as getChoices.

Both methods return an indexed array of programmes (the best recommendation is at index 0). Each entry is an associative array with the following key/value pairs:

KeyValue
pitem D
ttitle
ggenre
vmedia type
xexpiry date (optional) e.g. "2012/12/27 20:55:00"

Items beyond their expiry date (if present) will not be returned.

The engine includes a genre diversification post-filter which prevents the same genre appearing more than once in three consecutive recommendations. To disable set the diversify variable in the getRecs prototype to false.

Recommender model

The model file contains a kNN model and some basic item metadata which is used for filtering and presentation purposes. The metadata consists of title, genre, media type and an optional expiry data but additional fields can be added as required. For an example model file see:

The models can either use content-based filtering (based on item-attributes) or use collaborative filtering (based on user-item feedback). Two example files show how to build these models:

Note that these files have several TODO comments where you need to supply data of some kind. Both require this JAR file in the classpath:

Licensing terms and authorship

See COPYING

Authors

See AUTHORS

Acknowledgements

This work was co-funded through the European Commission FP7 project ViSTV-TV under grant agreement No. 269126.

Copyright

Copyright 2013 British Broadcasting Corporation

Something went wrong with that request. Please try again.