Cofi: A Java-Based Collaborative Filtering Library

This project is hosted on Savannah.


Collaborative filtering is the process of predicting ratings based on a database of ratings from various users. It is widely applicable to e-Commerce, e-Learning, and so on.

Currently, programmers who want to use collaborative filtering have to read the literature and implement their own algorithms. More often than not, programmers probably design their own algorithms and they will generally produce suboptimal algorithms. We want to build a foundation of already tested algorithms and documented that can be used in a wide range of contexts from research to applications.

The guiding principle is that the design should be thin. Cofi doesn't want to be all things for all people. So the focus is on delivering very few lines of code, and to rely on the programmer for providing the necessary glue.


picture of the MSN/Bell music recommender system, indiscover

If you prefer PHP, you might want to look at the following technical report (with code available on the same page): Daniel Lemire, Sean McGrath, Implementing a Rating-Based Item-to-Item Recommender System in PHP/SQL, Technical Report D-01, January 2005.


Cofi does not aim to be the definitive library and there might be better alternatives out there for you.


GPL, of course.

Who are we?

The project is lead by Daniel Lemire, professor at the University of Quebec at Montreal (UQAM).

The following students are or have been involved:

Where's the source?

You can download our Java source package. It requires gnu.trove (LGPL) and junit (CPL) libraries. Some code expects JSci (LGPL) though it isn't necessary to use the library.

filedatesize (better doc.)October 6th 2005180 Kb
cofi_code.zipFebruary 19th 2004142 Kb


The library is used as part of the RACOFI web site which is a live Music Recommender site and has been used for research ( COLA and IR). While it isn't a mature library, it is certainly quite usable in many real-world applications.

We support GCJ (free java environment) under gcc 3.2.2 (and above).

If you are not a developer, this is not for you!

Who do you complain to?

Visit Daniel Lemire's web page, find his email address and send him a polite note.