Ask HN: Has anyone built a recommendation engine in-house?
For example, a recommendation engine to recommend similar products, blog posts, movie, music, etc.
Would love to understand the challenges you faced and any library or third-party products (e.g., recombee) you used to power the recommendation engine.
41 comments
[ 3.3 ms ] story [ 40.3 ms ] threadhttps://github.com/ElementalWarrior/LearningAnalytics
https://people.ok.ubc.ca/bowenhui/analytics/
Content Based: If you can represent your products as a vector, you can have a distance between each product, then you have a item-item recommendation. You can use all kinds of embedding to achieve this results, some techniques that we tried are word2vec embedding of user navigation, auto encoding of features using neural networks, dimensionality reduction with PCA, ALS, etc. There are lots of libs for solving these problems as is a very studied field, usually numpy and for finding the neighbors we use ann from scikitlearn, because if you have millions of items, you cant just find the distance between all the pairs.
Collaborative - Filtering, here you use the pairs of behavior of the users, <user, item, ranking>. There is a surprise lib in python that works well, you have the MlLib from Spark too, this techniques are called matrix factorization techniques, and also gives you a embedding of the item or the user, and you can apply the techniques of content based to find user-user and item-item recommendations along the user-item recommendations
Hybrid Models: These are the models that use behavior and features of the user an items, LightFM is a good lib that works well, but you can model it with other tools like neural networks ( https://ai.google/research/pubs/pub45530 ).
The challenges are depending on the company, its not the same to recommended small amount of items to large number of users than large number of items to small number users.
There is a whole specialization in coursera that is really good https://www.coursera.org/specializations/recommender-systems
Since you're familiar w/ the youtube paper, I've been wondering this question: How do they get vectors out of the softmax?
In my company navigating politics is always the hard part, the marketing team would love to spam everyone all the time and the product and sales team would love to sell some kind of upgraded recommendation, its hard to push back but with metrics of coverage, ctr, precision, etc we usually kept them quiet with this metrics
[1] https://medium.com/@sadikkapadia/i-wrote-the-recommendation-...
When I finish my current work I will talk about that also. Some of my older work is speech recognition. Download my thesis.
However, I am wondering is there a recommendation engine as a service, which is similar to algolia available/possible.
I see only 2 players - yusp and recombee.
I'd appreciate any thought you have on this.
These kind of services aren't so much exposed to the public and likely don't start at <100 bucks a month, which could be why those services are not that visible. However, there are some e-commerce services going in that direction, such like AgilOne...
Netflix is clearly promoting its original shows. Do you think your system is still in use now that they've moved to thumbs rating and percent match score?
Amazing story! I don't know if it's true or if you're delusional, but I'm inclined to believe you as it would explain why Netflix recommendation system went downhill instead of improving.
There was really nothing wrong with the concept. A little JavaScript on the page, a bunch of back end magic, the ability to use a larger data pool because you are collecting from multiple sites.... But people wouldn't pay, and the engagement of recommendations was never that good.
The secret we learned was, after a bunch of math and research, was that 'best in this category and 3 closest adjacent categories works so well in retail that a naive algo did very well.
Better than the fancy math, which once associated the Koran with the sports illustrated swim suit edition ( and vice versa ).
There is a massive data sufficiency problem, and no company with the real data would go into this low end business. Small companies can't get enough data to be relevent.
The world is 10 years later, ml is better understood, so it might all be different now.... Pm me if you are interested in further detail
Technical aspects in how you train your models and such are fun, but way, way down the list of things that are likely to matter in the short to medium term. Like, data scientists are nice to have, but you're not really going to be able to fully utilize them until you have the capability to build, deploy, and test a model at scale. If going third party helps you do this, you probably should.
https://www.coollector.com/help.html#recommendations
There's a website named criticker.com which gives great movie recommendations, but you'll see that they have problems handling all the calculations. You'll literally see the recommendations being slowly generated, and updates are a problem when you rate more movies.
https://www.quantamagazine.org/teenager-finds-classical-alte...
This student's algorithm is quite different from mine, but I suppose that my algorithm is yet another example of solving the recommendation problem with classical computers.
At Theneeds we were recommending news = fresh content based on user's interest and other features. Because the content is fresh, you can't easily have enough data for a proper collaborative system.
Our algo was essentially the Reddit algo, where a piece of content gets a rank based on time and log of score. Score in Reddit is the upvotes - downvotes. At Theneeds we had a more complex score including social signals (likes on fb / RT on tw) so we could compute a meaningful score also without a big community of users. The other difference wrt Reddit was having different scores and different paces (multipliers) based on categories of content, so for example news in tech and politics from newspapers were updating faster than news on travel from magazines. And by normalizing the ranks, you can merge multiple categories in one -- a feature that I think Reddit also added.
As for the code/stack, custom written in python. We were using Redis to cache user timelines using sorted sets (including the guest users, i.e. the default top news for each category). In Redis, you can merge sorted sets, and we used it as an efficient way to create the new timeline when a new user was signing up.
[1] https://medium.com/@Pinterest_Engineering/introducing-pixie-...
Edit: added more details about tech.
I grow my own analysis code but use search APIs for storage and access (Lucene or Algolia)
I can train on multi-GB datasets w/ only lightFM and multiple CPUs.
Another interesting package is called Implicit. This package, although not as complete as LightFM when it comes to algorithms or APIs, really shines when it comes down to optimizations. Including native Cuda kernels for BPR and ALS it also has an important speedup called the Conjugate Gradient Method which makes it faster than spark in some benchmarks.
But usually, now-a-days my work requires more customized hybrid models of which I usually start w/ a base BPR implementation I have in Keras.