MyMediaLite Recommender System Library


Today's project is a little different than most. I've had this story queued for a while and have gone back and forth with writing it up or not. I think it's pretty cool, but I'm not sure how "fun" it is and it's kind of "out there" in some respects. What pushed me over the edge was the thought of how different it is, how we've not had anything really like this here before, how I don't see many like libraries and the thought of the cool stuff you might be able do with it...

MyMediaLite Recommender System Library 

MyMediaLite is a lightweight, multi-purpose library of recommender system algorithms.

It addresses the two most common scenarios in collaborative filtering:

  • rating prediction (e.g. on a scale of 1 to 5 stars), and
  • item prediction from implicit feedback (e.g. from clicks or purchase actions).

MyMediaLite is free software (open source software ), it can be used and distributed under the terms of the GNU General Public License (GPL) .

MyMediaLite: Features


MyMediaLite gives you a choice of many recommendation methods:

  • dozens of different recommenders
  • methods can use collaborative and attribute/content data

MyMediaLite is ready to use:

  • MyMediaLite includes evaluation routines for rating prediction and item prediction; it can measure MAE , RMSE , AUC , prec@N, MAP, and NDCG .
  • It also comes with command line tools for both tasks that read a simple text-based input format.

MyMediaLite is compact: The core library has a size of around 150KB.

Portability: Written in C#, for the .NET platform; runs on every architecture supported by Mono : Linux, Windows, Mac OS X.

MyMediaLite at ACM Recommender Systems 2011 in Chicago


Here's an example code snip of it in action;

using System;
using MyMediaLite.Data;
using MyMediaLite.Eval;
using MyMediaLite.IO;
using MyMediaLite.ItemRecommendation;

public class ItemPrediction
  public static void Main(string[] args)
    // load the data
    var user_mapping = new EntityMapping();
    var item_mapping = new EntityMapping();
    var training_data = ItemData.Read(args[0], user_mapping, item_mapping);
    var test_users = training_data.AllUsers; // users that will be taken into account in the evaluation
    var candidate_items = training_data.AllItems; // items that will be taken into account in the evaluation
    var test_data = ItemData.Read(args[1], user_mapping, item_mapping);

    // set up the recommender
    var recommender = new MostPopular();
    recommender.Feedback = training_data;

    // measure the accuracy on the test data set
    var results = Items.Evaluate(recommender, test_data, training_data, test_users, candidate_items);
    foreach (var key in results.Keys)
      Console.WriteLine("{0}={1}", key, results[key]);

    // make a prediction for a certain user and item
    Console.WriteLine(recommender.Predict(user_mapping.ToInternalID(1), item_mapping.ToInternalID(1)));

Some special notes: While it's all written in C# and the primary Project opens and compiles fine in VS2010 (for me at least), the referenced MovieDemo might be harder for many/most to compile. It's based on GTK-Sharp and there's a number of related references that the usual VS dev might not have. If you're a MonoDev user it might be easer for you...

In the end, if you've always thought about adding some kind of "recommender" feature to your application or site, but the thought of writing it yourself hurt your brain, you might want to check out this project...

The Discussion

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.