empty recommendations list
I am getting an empty list of recommendations. Why could it be?
How would we know without looking at your code ?
Sorry for that, I thought there could be a conceptual reason.
Nonetheless, here is some code:
from implicit.als import AlternatingLeastSquares
ials = AlternatingLeastSquares()
ials.fit(movielens.train.transpose())
ials.recommend(2, movielens.train, N=10)
In this code, I store a csr_matrix of shape (n_users, n_items) in movielens.train, which is basically the ml-100k dataset but with 10 ratings removed from each user only if the user has rated more than 20. Moreover, I set all ratings bellow 3.5 to 0, to treat it as an implicit dataset.
My thought is that maybe I am turning the movielens dataset to implicit wrongly.
Does the user have any liked item in the train set?
it seems to be the case because:
np.unique(movielens.train[2, :])
array([0., 4., 5.], dtype=float32)
@srcolinas - I believe in this case the user will get a zero vector for their factors, because of this code: https://github.com/benfred/implicit/blob/master/implicit/_als.pyx#L165 I'm surprised that it doesn't return anything though (I would have thought it would return random results instead here).
I'm not sure what the correct behaviour here should be - maybe throw an error?
@benfred throwing an error seems ok