Recommender System framework for julia


Build Status Coverage Status

####Collaborative Filtering in Julia.

Installation: at the Julia REPL, Pkg.clone("")

Reporting Issues and Contributing: See


The main aim is to create a framework that facilitates the study of recommender systems in Julia.


Colaborative Filtering Model is defined as a type. It has two required methods: new and predict. As shown in the example below:

type NewModel <: CFModel


  function NewModel(data::Dataset)
    this = new()

    this.predict = function(data::Array)
      return zeros(size(data)[1])

    return this

The first parameter is a Dataset Type. He has the information of users and items. It used a CSV file as input of a Dataset. If the filename is not passed the framework will use the MovieLens 100k database. An example of how to create a dataset:

dataset = new Dataset()
model = NewModel(dataset)

It is very common to evaluate the performance of this model. Then you can create an experiment using Hold-Out strategy (10% for testing and 90% for training) and the framework will test the model by calculating the MAE, RMSE and coverage. If the filename is not passed to the experiment the framework will use the default database.

experiment = Recsys.HoldOut(0.9)

function how_to_create_model(data)
  return Recsys.ImprovedRegularedSVD(data, 12);

result =

@show mean(result[:mae])

You can also use KFold strategy.

experiment = Recsys.KFold(10)

function model(data)
  return Recsys.RegularedSVD(data);

fold = 1

@show, fold)

You can also run all folds automatically. The method will return a dataframe with the results.

using Recsys

experiment = Recsys.KFold(10);

function model(data)
  return Recsys.GlobalMean(data);

result = experiment.runAll(model)

@show mean(result[:mae])