How to Optimize Recommendation Results with Genetic Algorithm – Towards Data Science

Photo by Jakob Owens on Unsplash

Recommender systems have been applied in various industries nowadays, including e-commerce, marketing, video streaming, financial industries and so on. There are different types of algorithms out there, including collaborative filtering, content-based filtering, and reinforcement learning based recommender. However, sometimes the implementation of recommender algorithm is only a starting point there are always requirements to evaluate and further optimize the results based on business needs. In this post, we will be using a small subset of the classic dataset for recommendation study movielens dataset, to demonstrate how to use genetic algorithm to further optimize the recommendation results.

In terms of the recommendation algorithm, we will use the widely used collaborative filtering method ALS (Alternative Least Squares), which is provided by Spark MLlib. This approach is especially preferred when dealing with large datasets, although in our case study we are only using a small dataset for illustration purpose. The sample code of a basic ALS based recommender is as follows:

With just a few lines of code, we have a simple movie recommender model established. The next question is, how do we evaluate the performance of the recommender?

The answer for this question really depends on how to frame the problem, as well as the business context behind this model. For instance, if we are just building the recommender for learning purpose, then we can simply evaluate recommender output

Originally posted here:

How to Optimize Recommendation Results with Genetic Algorithm - Towards Data Science

Related Posts

Comments are closed.