# A few notes...

First, thanks to Kaggle and H&M for providing a very interesting and well-designed challenge. I can't think of another recent competition where the winning solutions employed such a variety of different techniques. Also thanks to the Kaggle community for sharing insights, especially
[@paweljankiewicz](https://www.kaggle.com/paweljankiewicz)
for providing the basic structure that I think just about everyone used. And congratulations to the winners!
I don't have much experience with Recommendation systems, so this competition gave me the opportunity to learn about a lot of different techniques. There's no point in detailing my solution since the winning solutions are superior, but here are a few things I discovered that may be of use in future projects:
I experimented with several Python CF packages. In the end I used Implicit (
[https://github.com/benfred/implicit)](https://github.com/benfred/implicit))
, which gives good results and is faster than some of the others. cmfrec (
[https://github.com/david-cortes/cmfrec](https://github.com/david-cortes/cmfrec)
) is also good. One of the nice things about the Implict package is that in has a built-in topn estimator, which most of the other packages lack. (One note about the Implicit package: the current Kaggle environment has an old version that is missing some key functionality.)
For ranking, I used LightGBM and experimented with regression, logistic regression, and lambdarank (actually rank_xendcg). Surprisingly, I got the best results from simple regression. In theory, lambdarank should work much better but I couldn't get it to perform well. I'm wondering if there's something in the hyperparamer settings that I missed?
My candidate retrieval algorithms generated an average of about 130 candidates per customer, but for training the ranking model, I sampled the negatives. In my case, the best ratio of positives-to-negatives was 1-7.
I think most of us had the experience of a major improvement in our CV score, but no improvement on the LB. One thing I noticed is that the gap between my CV and LB gradually expanded, but also became more consistent, as my scores improved. I think others have noted this as well. I wonder what would cause this effect?
My final submission was:
CV: 0.03572
LB: 0.03277
PB: 0.03336