# What are some nice algorithms/techniques for optimizing and predicting Click Through Rates (CTR)?

Definition of Click Through Rates:

CTR is the number of clicks that your ad receives divided by the number of times your ad is shown expressed as a percentage (clicks ÷ impressions = CTR).

Logistic regression is very common and efficient.

This will provide you with a probability of click for a given impression. You will likely need additional information for optimization, like keywords or A/B testing.

• Thank you for the answer. Yeah, it is one of the methods. And I have found Bandit algorithms perform really nice (better than Logistic and A/B). Please have a look at my answer below :) Commented Nov 16, 2015 at 18:01

There are a group of algorithms (or techniques) called the Bandit algorithms, which deal especially with the problem statement, which is the optimization of Click-through rates of advertisements.

The problem is framed in a setting of multiple bandits with vending machines. There are various strategies which can be implemented:

• Epsilon-greedy strategy
• Epsilon-first strategy
• Epsilon-decreasing strategy
• Contextual Epsilon strategy

Reference on why Bandit algorithms are better than A/B testing frameworks.

I've tried the following algorithms:

1. Factorization Machines by Steffen Rendle - Really good algorithm for sparse feature sets, in construct to polynomial-regression. Measures the interaction between features. Model that in addition to learning linear weights on features, learn a vector space for each feature to learn pairing interactions between features in this new space.

2. Field-Aware Factorization Machines - an improvement of the FM model. Recently, have been used to win two Kaggle's click-through rate prediction competitions.

3. FTRL - "Follow The (Proximally) Regularized Leader" algorithm - regularized online logistic regression. Equivalent to Online (Stochastic) Gradient Descent when no regularization is used. Very easy to implement.

4. AdPredictor algorithm by Microsoft The algorithm is based on a probit regression model that maps discrete or real-valued input features to probabilities. It maintains Gaussian beliefs over weights of the model and performs Gaussian online updates derived from approximate message passing.

• Thank you. Can you please explain a bit more about them? Commented Dec 9, 2015 at 10:15
• Added information in my comment. Please note that in my opinion any of these algorithm can't really be explained in one line, you'll have to read the articles. Commented Dec 9, 2015 at 13:57
• In addition, do you have code implementation of a Bandit algorithm? I would give it try on my dataset. Commented Dec 9, 2015 at 14:01
• Is there an open-source implementation or at least a binary for Microsoft's AdPredictor? Commented Nov 23, 2016 at 13:17

You can see nice algorithms in kaggle competitions about CTR:

Just go to forum of each competition and search for winning solutions ;)

Factorization machines - libfm open source software has been used widely among top companies in recommender applications.

Check it out. It contains various algorithms to play with (e.g. stochastic gradient descent).

I guess your data has like "click/view" label for each pair of user-product or say cookie-advertisement saying "whether user clicked or just viewed product". You can treat this as binary classification with two classes click or just view.

• Can you please elaborate a bit more on your answer Commented Nov 18, 2015 at 13:54
• edited. Check it out. Hope its useful. Commented Nov 18, 2015 at 15:00
• I really didn't apply this till now. (Would do it though). As I have self-answered, using the Bandit algorithms proved very useful. Commented Nov 20, 2015 at 12:30