Recsys.jl

Recommender System framework for julia

Recsys.jl

Build Status Coverage Status

####Collaborative Filtering in Julia.

Installation: at the Julia REPL, Pkg.clone("https://github.com/filipebraida/Recsys.jl.git")

Reporting Issues and Contributing: See CONTRIBUTING.md

Goal

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

Examples

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
  globalMean::Real

  predict::Function

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

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

    return this
  end
end

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);
end

result = experiment.run(how_to_create_model)

@show mean(result[:mae])

You can also use KFold strategy.

experiment = Recsys.KFold(10)

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

fold = 1

@show experiment.run(model, 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);
end

result = experiment.runAll(model)

@show mean(result[:mae])