using Persa

struct RandModel <: Persa.Model
end

Persa.predict(model::RandModel, pref::Preference, user::Int, item::Int) = rand(pref.possibles)

pref = Preference(1:5)

data = [
   UserPreference(1, 1, Rating(4, pref)),
   UserPreference(1, 3, Rating(2, pref)),
   UserPreference(2, 1, Rating(4, pref)),
   UserPreference(2, 2, Rating(5, pref)),
   UserPreference(2, 3, Rating(3, pref)),
   UserPreference(3, 1, Rating(3, pref)),
   UserPreference(3, 2, Rating(4, pref)),
   UserPreference(4, 2, Rating(5, pref)),
   UserPreference(3, 3, Rating(4, pref)) 
]

dataset = Dataset(data, 4, 3, pref)

model = RandModel()

mach = machine(model, dataset)

mach[2, 3]