Based on the conversation in MAHOUT-1274, I put some code here:

https://github.com/gcapan/mahout/tree/onlinerec
I hope that would initiate a discussion on OnlineRecommender approaches.

I think the OnlineRecommender would require (similar to what Sebastian
commented there):

1- A DataModel that allows adding new users/items and performs fast
iteration
2- An online learning interface that allows updating the model with a
feedback, and make predictions based on the latest model

The code is a "very early" effort for the latter, and it contains a matrix
factorization-based implementation where training is done by SGD.

The model is stored in a DenseMatrix --it should be replaced with a matrix
that allows adding new rows and doesn't allocate space for empty rows
(please search for DenseRowMatrix and BlockSparseMatrix in the dev-list,
and see MAHOUT-1193 for relevant issue).

I didn't try that on a dataset yet.

The DataModel I imagine would follow the current API, where underlying
preference storage is replaced with a matrix.

A Recommender would then use the DataModel and the OnlineLearner, where
Recommender#setPreference is delegated to DataModel#setPreference (like it
does now), and DataModel#setPreference triggers OnlineLearner#train.

Gokhan

Reply via email to