#### What is the CPI algorithm?

CPI algorithm is the end-to-end data science solution to run install-driven campaigns on RTB. These Campaigns are called CPI campaigns. The function of the CPI Algorithm is to generate bid values to be used in RTB which will lead to achieving the campaign objectives of CPI at scale.

#### What are the main components of CPI algorithm / How CPI campaigns are optimized?

There are 3 components in the CPI algorithm.

- Prediction Model
- PI Controller (Factor)
- Auto blacklisting Tool

*Note:** In addition to the CPI algorithm, all CPI campaigns automatically leverage a multi-armed-bandit model for creative optimization to identify and maximize the delivery of those creatives in a campaign that yields the best IPM (installs per mille of impressions) and thereby the lowest eCPI. The creative optimization algorithm works orthogonal to the CPI algorithm and can hence be looked at as an on-top optimization that works to achieve the same goal: achieving a better eCPI. Read more at the end of this article.*

#### How does the Prediction Model (dCVR) work?

Prediction Model is a logistic regression model trained to predict the probability of install given a set of variables associated with every bid request. The Prediction Model uses the publisher side, advertiser side and user-side features in the model.

#### The prediction model’s output oscillates between 0 and 1.

#### What is the PI Controller (Factor)?

CPI campaigns come with a 2 dimensional objective (target CPI, volume). For the available supply, it is often not possible to simultaneously achieve both the objectives. PI controller is designed to achieve maximum possible volumes while not exceeding the target CPI. The output value the PI Controller produces is called “Factor”.

The Factor is multiplied with the Prediction Model and thereby works as a corrective factor to the predicted bid value calculated by the model. If the Factor is >1, then bid prices are adjusted upwards, if it is <1, bid prices are adjusted downwards.

PI Controller has 2 modes:

*Budget mode (Exploration Mode)*– algorithm aims to find new profitable pockets of inventory by taking risks on “unproven” inventory.*CPI Mode (Optimization Mode)*– algorithm aims to be profitable and “optimize” the pockets of inventory that deliver good performance.

Every campaign starts off in a Budget mode and will shift to CPI mode when it violates a total loss threshold of $100. The “loss” is defined as the cumulative media cost minus the target CPI multiplied by the number of installs achieved. It reflects the theoretical ‘loss’ being the delta between the eCPI and the target CPI. It is possible to override the default thresholds and set them to any desired value. This can be done even in the middle of a campaign’s lifetime if it is still in exploration mode or when it is being reverted to exploration mode.

During the *budget mode (exploration)*, the PI controller is programmed to make sure the assigned daily campaign budget is spent. If the daily budget is estimated to not be exhausted, the Factor will increase and as a result the bids will increase as well. During exploration phase the daily campaign budget can hence be used as a tool to control the aggressiveness of bids.

During the *CPI mode (optimization)*, the PI controller is programmed to meet the target CPI. If target CPI is overachieved, the Factor will increase to achieve more scale (as long as the campaign has enough daily budget), if the target CPI is underachieved (i.e. eCPI > target CPI) the Factor will decrease and as a result the bids are less aggressive. During optimization phase, the daily campaign budget can hence be used as a tool to control the scale of a campaign. It is advised to keep the daily budget of a campaign at about 2x or more of the actual media spend to avoid that the campaign becomes constrained by budget.

The following is the formula comprised of Factor, Prediction Model (dCVR) and target CPI (tCPI) which determines the final bid price:

**Bid Price = Factor * dCVR * tCPI **

#### What is the Auto Blacklisting Tool?

Auto Blacklisting tool is a safety net on top of the model. This tool identifies loss making apps and blacklists them. It identifies loss making apps by a probability model. The tool defines a prior distribution for loss (or profit) of every (app, campaign) combination. At regular intervals, it computes the probability that loss > 0 (the probability that the app is a loss making app).

*Blacklisting rule:* blacklist if probability (aCPI>= 3 * tCPI) > 85%. This ensures that an app gets blacklisted only if there is sufficient data to conclude that it is a loss-making app. Once there is sufficient data, this tool avoids any further losses by immediately blacklisting the app if it is found to be loss-making.

How to achieve the best possible results.

It is recommended to configure the various variables of the CPI Algorithm to best reflect the individual setup and goals of a campaign to achieve the best possible results. Your Kayzen support will be happy to assist you with advice.

**What is Creative Optimization?**

Creative Optimization is a feature within CPI-optimized campaigns that will distribute creatives (of the same dimensions) in a given campaign based on their performance. The algorithm starts with exploration then after a statistically significant threshold, turns to the optimization of creatives. CPI campaigns start in exploration by bidding equally on all creatives (of same dimensions), then optimize by delivering more bids to the creative which yields the best probability of install. Creative optimization also works when you add creatives to an existing campaign. Thereby, you can constantly test and iterate new creatives and let the system automatically choose and keep the best-performing ones. However, if you want an entirely “clean” A/B test of creatives we recommend to start those creatives on a new campaign to avoid any bias created by the learnings the model already made on features such as creative_bundleID combination.

Best practices for creative optimization:

1) If possible try not to add new creatives to a campaign specifically if it has been running for a significant time.

2) Try to club homogenous creatives in a campaign to better utilize the model and Creative Optimisation.

3) Do not pause/delete all the current creatives of the running campaign. It is recommended to keep at least 1 good performing creative while adding new ones. You can pause/delete the old one once newly added creatives pick up in performance.

4) If you would like to perform somewhat unbiased AB test, do not put *creative_A* and *creative_B* in the same campaign. Instead, keep *creative_A* in one campaign and put *creative_B* in a new clone campaign. Launch these campaigns at the same time and make sure all settings are identical except creatives.

*Explanation: *Currently, until the next creative optimization update, Kayzen algorithm does not divert the same traffic to different creatives, meaning that Creative_A and Creative_B will receive different traffic. In such case creative_A may outperform creative_B just because it was run on different traffic, in other words it would be impossible to judge creatives without placement performance bias.

*§ Note that "explore" vs "optimize" in the context of Creative Optimization is independent of the CPI Campaign explore vs optimize phase. i.e. the creatives can start optimizing before the campaign itself has turned to optimize mode, and vice versa.*