Redis Too is a Redis module that implements a Jaccardian similarity and memory-based collaborative filtering recommendation engine.
To build and load:
make
redis-server --loadmodule ./too.so
To add likes and generate recommendations:
# Add likes
redis> TOO.LIKE movies "The Shawshank Redemption" Sonic
redis> TOO.LIKE movies "The Godfather" Sonic
redis> TOO.LIKE movies "The Dark Knight" Sonic
redis> TOO.LIKE movies "Pulp Fiction" Sonic
redis> TOO.LIKE movies "The Godfather" Mario
redis> TOO.LIKE movies "The Dark Knight" Mario
redis> TOO.LIKE movies "The Shawshank Redemption" Mario
redis> TOO.LIKE movies "The Prestige" Mario
redis> TOO.LIKE movies "The Matrix" Mario
redis> TOO.LIKE movies "The Godfather" Peach
redis> TOO.LIKE movies "Inception" Peach
redis> TOO.LIKE movies "Fight Club" Peach
redis> TOO.LIKE movies "WALL·E" Peach
redis> TOO.LIKE movies "Princess Mononoke" Peach
redis> TOO.LIKE movies "The Prestige" Luigi
redis> TOO.LIKE movies "The Dark Knight" Luigi
# Refresh recommendations
redis> TOO.REFRESH movies Sonic
redis> TOO.REFRESH movies Mario
redis> TOO.REFRESH movies Peach
redis> TOO.REFRESH movies Luigi
# Get recommendations
redis> TOO.SUGGEST movies Luigi
1) "The Shawshank Redemption"
2) "The Matrix"
3) "Pulp Fiction"
4) "The Godfather"
TOO.LIKE class item user
: Addsitem
of typeclass
to the user's list of likes.TOO.UNLIKE class item user
: Removesitem
of typeclass
to the user's list of likes.TOO.DISLIKE class item user
: Addsitem
of typeclass
to user's list of dislikes.TOO.UNDISLIKE class item user
: Removesitem
of typeclass
to user's list of dislikes.TOO.REFRESH class user
: Refreshes list of suggestions foruser
of typeclass
.TOO.SUGGEST class user
: Returns list of suggestions foruser
of typeclass
.
Contributions are welcome.
- Add tests.
- Ignore items added to the
ignores
list. - Add an option to auto-refresh suggestions.
- Add an option to limit the number of similar users to check when refreshing suggestions.
Redis Too is available under the BSD (3-Clause) License.