FaceBook thesis on the Promotion of CTR

Practical Lessons From Predicting Clicks on Ads at Facebook

Papers on improving the accuracy of the CTR (Click Through Rate) algorithm utilizing GBDT and LR combination of the Facebook article is published in 2014.

background

CTR is pushed to a customer refers to whether the goods will be clicked in order to improve profitability, we must push the big hits as merchandise to customers.

Expression tree model using the integrated stronger, better features and found effective combinations of features, rather than a single tree of the tree model, expression is weak, and can not express a plurality of differentiated features combination.

Using GBDT contribution, which mainly have split feature characteristic discrimination for most samples, but were reduced in the direction of the gradient residuals, greater help to improve the purity of the sample when GBDT each division.

Evaluation metric

  1. Normalized Cross-Entropy:

    NE is equal to the predicted log loss divided by backgroud CTR entropy value NE smaller the better performance of the model.

  2. Calibration:

    Click on the desired amount divided by the actual number of clicks, the better its value is closer to 1 indicates the model performance.

Model architecture

After several experiments, Facebook summed with the correct model + strong feature is the most effective way to improve performance, the correct model refers logistic regression (the LR) + gradient lifting tree (GBDT) , refers to the intensity characteristics features hereinafter, user history and feature .

Decision Tree feature transfer

Speaking of the article, GBDT is a method of converting a non-linear characteristic linear powerful and convenient means.

For example the following diagram: For the input samples x, depending on the particular division principle, the root node is split into two subtrees of a final split into three sub-tree leaf node, the second teeth eventually split into two sub-tree leaf node. A first leaf node is assumed that x falls within the first subtree and a second subtree teeth second leaf nodes, you can use the vector [1,0,0,0,1] x represented.

 

 

After that, the author through three sets of experimental data comparing concluded: LR + Trees can get the best NE index, that predict the effect

 

It is the best.

 

Data freshness

网络广告的个性化推荐往往是建立在动态的环境中的,而且受到多种因素的影响,如:CPU负载,内存,一棵树的叶子结点数量等。在实际中,可以采用多核并行的方式支持全部的训练集和大内存。

在线线性分类器

为了最大限度地提高数据新鲜度,文章中比较了五种设置学习速率的方法,分别为:Per-Coordinate, Per-weight square root, Per-weight, Global learning, Constant learning。其中per-coordinate配合随机梯度下降算法可以得到最高的预测准确度。

Global learning 和 Per-weight 表现出来的预测程度最差,其原因分别为:

  1. Global learning的失败是训练实例与特征之间的不平衡导致的。

  2. per-weight的失败是由于学习速率下降太快导致的,训练结束太早以至于数据尚未覆盖就被终止了。

线上模型架构 online data joiner

 

广告展示生成特征,用户给出点击或不点击的行为,由OJ捕获用户行为并且生成新的训练样本加入到Trainer中,然后由模型反作用于Ranker系统将广告进行排序(个性化推荐的过程),用户又看到了新的广告,决定是否点击。如此循环,形成一个闭环系统。

最关键步骤是将labels(click/no-click)以一种在线的方式与训练输入结合起来。这需要设定一个合适的等待时间窗口,如果时间窗口设置得过大,会导致资源被白白浪费在等待上,如果时间窗口设置得太小则会导致用户的点击行为未被记录就直接被标记成未点击。

文章中提出了一种使用hash队列解决的方案,其具备查询、添加、删除三个方法,只有在用户关闭了所有窗口之后队列中的元素才会被加入trainer进行训练和分析。

保护机制:一旦基础数据出现了较大的问题导致CTR骤降时, Anomaly Detect Mechanism就会自动断开OJ与训练集的联系,防止过拟合扩散。

stream to stream:在线的网络数据分析,需要采用流机制进行处理而尽量避免使用批处理机制进行处理,使用批处理机制进行处理无法实现动态响应客户行为变化,使用stream机制,当一条数据处理完毕之后,执行序列化然后立即通过网络传输到下一个结点,具有较好的实时性。

潜在问题与内存

  1. 决策树的数量,trees的数量从1增加到2000,叶节点个数被限制为最大12个,submodel之间的区别在于训练数据大小的不同。可以看到随着决策树的增加,模型的性能不断提升,但是绝大部分性能的提升都在前500个trees,而后面的1000个trees的提升甚至都不到0.1%。

     

     

  1. 特征的重要性,为了在资源消耗和模型性能之间做到平衡,可以通过控制Feature Count来调节,如果需要删掉一些特征,就需要研究特征的重要程度。特征的重要程度可以按照使用该特征进行分裂所带来的loss减小积累量

  2. 上下文特征和用户历史特征。

    • 上下文特征是指用户在浏览当前窗口时产生的最新数据。

    • 历史信息特征是指用户或者广告先前的一些信息。

    文章指出,历史信息特征相较于上下文特征提供了更有力的解释,并且历史信息特征在训练中的重要性要大于上下文特征。但是上下文特征在解决冷启动问题上有优势,对于新的用户和广告,历史信息不足,此时上下文特征对于给出一个合理的CTR预测是必不可少的。

阅读感受

认识了很多新的概念,也收获了新的知识,如逻辑回归,决策树模型和贝叶斯算法。

逻辑回归

在文章中采用的主要是线性分类器,目标问题是用户对广告的点击与不点击,所以使用回归模型可以得到较好的拟合。

直观表示:

x为特征空间,θ表示特征权重,y表示因变量。从本质上来说,逻辑回归的主要任务就是从大量的样本数据中获得一组权值θ,当有新的测试数据输入时,这组权值可以与这组数据进行向量运算,进而利用sigmoid函数映射到0-1空间。

 

 

 

外层函数——sigmoid

当假设函数大于等于0.5我们可以将其定义为正类,反之定为负类。

代价函数

由于LR模型使用的外层函数为sigmoid函数,所以我们想到使用对数损失函数,当预测准确度非常高时,惩罚代价几乎为0,当预测得非常不准时,惩罚代价接近无穷大。

 

 

当实际结果与预测结果相符时,此时代价最小,为0;

当实际结果与预测结果相反时,此时代价最大,为无穷大。

 

 

决策树模型

思想:自上而下,分而治之。

建树:

  1. 将所有数据看成根节点;

  2. 根据划分准则,从属性中挑选一个结点进行分裂;

  3. 生成若干子节点,对每个结点进行判断,如果满足则停止分裂;

  4. 设置该节点为叶子结点,其输出结果为该节点数量占比

递归返回条件:

  1. 当前结点包含的样本完全属于同一类别,无需划分;

  2. 当前属性为空,或者样本属于同一类别;

  3. 当前结点包含的样本集合为空,不能划分。

划分准则:

  1. 信息增益

    • 信息熵

       

       

      样本集合D中第k类样本所占的比例为pk;假设属性a有V个不同的取值,若使用a来对D进行划分,则会产生V个分支结点,记第V个分支结点上的样本为DV,可以计算其信息熵的权重|Dv|/|D|,进而计算出以a作为划分标准的信息增益为:

       

       

    信息增益对可取值数目较多的属性有所偏好。

  2. 增益率

     

     

    信息率对可取值数目较少的属性有所偏好。

  3. 基尼指数

     

     

    反映了从数据集D中抽取两个样本,其类别标记不一样的概率。

贝叶斯分类朴素

要求各个特征之间互斥

 

 

要根据特征推理类别时,可以转化为等号右边的形式,等号右边的值可以通过训练数据得到近似。

优点:

  • 逻辑简单算法易于实现

  • 分类过程时间和空间的复杂度较低

缺点:

要求属性特征之间相互独立,这个假设在实际应用中往往不成立。

 

Guess you like

Origin www.cnblogs.com/1-Gary-1/p/11119751.html