I have two questions related to the LightFM model:
- I read the article about the model and I see that it uses sigmoid f(.)-function. I also checked library's Cython code and I see that the function is implemented there as well. However, the model is applicable to rank items in the rating setting (rating from 1 to 5). Why isn't sigmoid harming the ranking system? I mean it returns the value from 0 to 1, why the model still works for ratings?
- Am I correct that the scores which model returns is q_u * p_i + b_u + b_i (see the article)? If not, how can I calculate the scores myself? Where do they come from and why their magnitude is so high? I get the scores approximately from -100000 to +100000.
UPD1: I followed the comments and found out the following function:
cdef inline flt compute_prediction_from_repr(flt *user_repr,
flt *item_repr,
int no_components) nogil:
cdef int i
cdef flt result
# Biases
result = user_repr[no_components] + item_repr[no_components]
# Latent factor dot product
for i in range(no_components):
result += user_repr[i] * item_repr[i]
return result
It seems like the scores are indeed the formula above, but it would be helpful if someone could also have a look - I'm not very good with Cython
UPD2: sigmoid is used only for the logistic variant of the model. It's not used if you try WARP.