benfred / implicit

Fast Python Collaborative Filtering for Implicit Feedback Datasets
https://benfred.github.io/implicit/
MIT License
3.57k stars 612 forks source link

mpdel.recommend/performance #643

Closed CodeTilde closed 1 year ago

CodeTilde commented 1 year ago

I have gotten poor results using the implicit recommender and I am looking for the reason. I have a binary pandas data frame for training in the form of user_item. mat = csr_matrix(usermedia_df.astype(pd.SparseDtype("float64",0)).sparse.to_coo()) model = AlternatingLeastSquares(factors=f, regularization=reg, alpha= alpha) model.fit(mat) For each user that is in test part I apply the recommendation as follow: mids, scores = model.recommend(ind, mat[ind], N=n)

I take the mids as the list of indices for the recommended items . I have tried the following ranges for different parameters

reg_list= [ 0.01, 0.02, 0.04, 0.06 ,0.08, 0.1, 0.5] factor_list= [32, 64, 128, 256] alpha_list = [1, 20, 30 , 40, 50]

The best result I could get was 15 right recommended items over 1500 available items in the test data.

benfred commented 1 year ago

Those results seems pretty bad, especially given your dataset only has 1500 items.

Do you have a dataset you can share - as well as a complete script for training (including reading from disk etc)?