How to optimise model parameters?
Hi! I'm just starting out so this may be a basic question: I'm using the lastfm dataset to get artist recommendations, with the lastfm.py example. I've removed 20% of each user's top-rated artists from the lastfm360k dataset (set their plays to zero in the plays matrix), and testing to see if they get recommended. I'm assuming I need to optimise the model parameters, since I'm going to train the model on the modified dataset. But I don't know how to optimise these parameters: number of factors, iterations and regularization. Would someone be able to explain how to do this? Also, do I need to also change the b25 weighting parameters, K1 and B, if I'm using ALS? Thanks!
It's just like other machine learning models do.
One of easiest approaches is grid-search. Please refer to https://scikit-learn.org/stable/modules/grid_search.html
There're quite many rules-of-thumb for fitting ALS or BPR such that larger confidence values will work better for a more sparse dataset. Yet I can't find a good reference one.
Reading the original papers will be helpful too.
@nicolaneo
If you want to implement GridSearch like @ita9naiwa mentioned, you should probably take a look at this link: https://gist.github.com/jbochi/2e8ddcc5939e70e5368326aa034a144e
@nicolaneo - You might find Scikit-Optimize useful too, in particular I've had some success with BayesSearchCV in the past (depending on problem-size).
@markdouthwaite - thanks for the BayesSearchCV tip. Looks like the Bayes search is as easy as swapping out GridSearch. When you say problem size, what kind of dimensions are we talking? My dataset consists of 1-2m~ transactions per quarter ranging across a few thousand customers and unique items.
@kmcmearty - I've run BayesSearchCV with at least an order of magnitude more data on a moderately sized machine with no issues. Needed a bit of patience though!