September 6th, 2019
Driverless AI can help you choose what you consume nextRSS Share Category: Driverless AI, Machine Learning, Recipes, Recommendations, Technical, Tutorials
By: Parul Pandey
Last updated: 09/06/19
Steve Jobs once said, “A lot of times, people don’t know what they want until you show it to them’. This makes sense, especially in this era of constant choice overload. Consumers today have access to a plethora of products just at the click of their mouse. These innumerable choices can sometimes turn out to be confusing and hampering and do more harm than good. For instance, a company may offer millions of products on its website, but how does a consumer find a new and appealing product from amongst those? Also, wouldn’t it be great if the company could provide choices to every consumer based on their past shopping history? This would not only save a lot of time but also provide them with highly personalized experiences. Such a customized filter relying on modern machine learning techniques constitutes a Recommendation System, and we shall see how Driverless AI can be used to create one.
Recommendation Engines try to make a product or a service recommendation to people. In a way, Recommenders try to narrow down choices for people by presenting them with suggestions that they are most likely to buy or use. A lot of companies today depend on their recommendation engines to help users discover new content on their sites.
Please note that in this article, the terms recommendation engine, recommender system and recommendation system will be used interchangeably and signify the same underlying idea.
Benefits of using Recommendation systems
By using an effective Recommendation System in place, companies can target and personalize content and product recommendations for its consumers. This results in increased customer engagement, increased loyalty, and hence increased sales. Some of the businesses that can benefit from effective recommendation systems are:
Types of Recommender Systems
There are many kinds of recommenders being employed in the industry today. The vital decision, however, is to decide which type suits our needs and what kind of data is available with us. The selection primarily depends on :
- What we want to identify and,
- What kind of relationship is specified in our data?
Some of the common approaches used for recommendations include:
Let’s have a brief overview of each one of them:
1. Content-Based Filtering
Content-based filtering involves recommending items based on the attributes of the items themselves. Recommendations made by content-based filters use an individual’s historical information to inform choices displayed. Such recommenders look for similarities between the items or products that a person had bought or liked in the past to recommend options in the future. The system recommends items similar to what a user has liked in the past.
Creating a Recommender system using Driverless AI
H2O Driverless AI is an artificial intelligence (AI) platform for automatic machine learning. Driverless AI automates some of the most challenging data science and machine learning workflows such as feature engineering, model validation, model tuning, model selection, and model deployment.
Driverless AI(1.7.0 and above) implements a key feature called BYOR, which stands for Bring Your Own Recipes. Recipes are customizations and extensions to the Driverless AI platform. One can create their own recipes, or select from several recipes available in the
https://github.com/h2oai/driverlessai-recipes repository. We shall use one of the available recipes to develop a Recommender system with Driverless AI.
Let’s build a Movie Recommender system. The system has no prior knowledge of the users or the movies but only the interactions that users have with the movies through ratings given by them. The idea is to learn from data and recommend best movies to users, based on self and others’ behavior.
It is important to note here that this is a regression problem. However, where we would want to predict if the user will buy a particular item or not, it will be a classification problem.
The dataset belongs to the famous Movielens site. MovieLens helps you find movies you will like. One can rate the movies to build a custom taste profile, and then MovieLens recommends other movies for you to watch.
The original data contains over 20 million ratings from 138,000 thousand randomly-chosen, anonymous users. However, for this article, we shall only be using a portion of the original data so that others can quickly reproduce the experiment. The sampled dataset data can be accessed from here. Here are the first few rows of the training data:
Next, we shall deselect the
RecH2OMFTransformer while keeping all the default ones intact. Keeping all the other parameters, the same as the previous experiment hit the launch button.
Hybrid Filtering Methodology
As the name suggests, a Hybrid Filtering method combines the properties of both Content-Based and Collaborative filtering methodologies to leverage both user-item and transaction data to give recommendations. For this experiment also, we shall select all the columns of the dataset(except the timestamp column) similar to Content-based experiment. However, the difference here will be that we shall choose the
RecH2OMFTransformer in addition to the other default transformers.
Make sure the
RecH2OMFTransformer is reflected along with other selected transformers on the experiment page. Go ahead and launch the experiment. Driverless AI will build multiple features using the various transformers and try multiple models to optimize the weights between the content-features and collaborative-features.
Experiment Results Summary
The screenshot below shows the comparison between the Collaborative, Content-Based, and Hybrid Recommender System’s results.
The pure collaborative approach has an RMSE of 0.96 while the content-based approach has an RMSE of 0.94. The hybrid approach combines both and clearly outperforms each with an RMSE of 0.92.
It is also interesting to note that XGBoost scores 0.98 on the raw features while LightGBM scores 0.99 on the same MovieLens dataset. Therefore, it is safe to conclude that Driverless AI’s recommendation recipes combined with its feature engineering and model-optimization perform better as compared to using plain open-sourced algorithms.
Top N recommendations
Once the experiment is done, users can download the predictions, just like any other Driverless AI experiment.