User 362 | 6/17/2014, 11:50:51 PM

Hi all,
I was trying to test the recommender with MatrixFactorizationModel.
In the function create I looked into parameters specific to MatrixFactorizationModel.
One of them is "linear*regularization" whose purpose is to control "Regularization for linear term".
I have several queries about this parameter:
1. Which linear term are we talking about in this context?
2. Also for recommender.create function we have two parameters "user*data" and "item*data". What are there purpose (specifically in context of MatrixFactorizationModel)?
3. Do we have tutorials underlining the use of "linera*regularization" of MatrixFactorizationModel, "user*data" and "item*data"? If not can we have one?
4. Also can anyone direct me to appropriate literature which will have discussion about linear_regularization for linear term in MatrixFactorizationModel?

Thankfully Mahmud

User 19 | 6/19/2014, 5:20:34 PM

Hi Mahmud,

For MatrixFactorizationModel, there are a few components to the prediction for user u and item i:

y*ui = \sum*f X*uf beta*f + \sum*f W*if gamma*f + \sum*k theta*uk phi*ik

where X*uf is a side feature value for user u and user feature f, and W*if is a side feature value for item i and item feature f.
The last term is the classic matrix factorization term, and the "linear*regularization" term applies regularization to the parameters involved int he first two terms, beta*f and gamma_f. At the moment this is restricted to data sets with explicit feedback, e.g. ratings, etc.

We are about to release a tutorial that shows how one can use user*data and item*data, so keep an eye out for that!

User 89 | 6/19/2014, 5:21:38 PM

Hello Mahmud,

I'll answer part of your questions now, and we'll be getting out a notebook soon that details the rest. (We can email you the draft immediately.)

The objective in the matrix factorization that we are using is the following:

Suppose we have users indexed as i \in {0, 1, ..., n*u-1}; items indexed as j \in {n*u, n*u + 1, ..., n*u + n*v}; and side features having indices k \in {n*u + n*v + 0, n*u + n_v + 1, ..., N}.

Using this indexing, we can list the linear features as a vector w of length N, so w*i is the linear weight associated with user i and w*j is the linear weight associated with item j. Similarly, denote the D-length latent factors for the user and items as V*i and V*j -- thus V is a matrix of size (n*u + n*v) by D.

With no side features, the current objective is

\sum*((i, j, y) in observations) L (V*i' V*j + w*i + w*j, y) + (lamba*w / 2) || w ||^2 + (\lambda_V / 2) ||V||^2,

where y is the centered rating for user i and item j. L(y', y) is the squared error loss function. \lambda*w is the linear regularization term and \lambda*V is the factor regularization term. || . || denotes the L2 norm.

With side features, denote x*i as a vector over the side terms that is associated with user i, and let z*j be a similar vector over the side terms associated with item j. Many of these terms can be zero. Thus x*ik is some value for feature k that occurs when user i is seen. (This is basically the factorization machine notation). Basically, one can think of this like a database join -- each time user i comes up, the side vector x*i: is joined onto the observation vector.

Then the objective function is

\sum*((i, j, y) in observations) L (V*i' V*j + w*i + w*j + \sum*k x*ik *w*k + \sum*k z*jk*w*k, y) + (lamba*w / 2) || w ||^2 + (\lambda_V / 2) ||V||^2,

We're planning on adding some functionality to this soon, with more control over the regularization for specific parts of the problem, so if you have specific needs in this regard, please let me know. I'll send you updates as specific.

Hope that helps! Let me know if it isn't clear.

Thanks! -- Hoyt