1. 前言

前面博客介绍了CTR预估中的贝叶斯平滑方法的原理http://www.cnblogs.com/bentuwuying/p/6389222.html

这篇博客主要是介绍如何对贝叶斯平滑的参数进行估计,以及具体的代码实现。

首先,我们回顾一下前文中介绍的似然函数,也就是我们需要进行最大化的目标函数:

下面我们就基于这个目标函数介绍怎样估计参数。

2. 参数估计的几种方法

1. 矩估计

矩估计在这里有点乱入的意思:),因为它其实不是用来最大化似然函数的,而是直接进行参数的近似估计。

矩估计的方法要追溯到19世纪的Karl Pearson,是基于一种简单的 “替换” 思想建立起来的一种估计方法。 其基本思想是用样本矩估计总体矩. 由大数定理,如果未知参数和总体的某个(些)矩有关系,我们可以很自然地来构造未知参数的估计。具体计算步骤如下:

1)根据给出的概率密度函数,计算总体的原点矩(如果只有一个参数只要计算一阶原点矩,如果有两个参数要计算一阶和二阶)。由于有参数这里得到的都是带有参数的式子。比如,有两个参数时,需要先计算出:期望aaarticlea/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCABDAPgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAA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+β),D(x) = αβ / (α+β)2(α+β+1)。

2)根据给出的样本,按照计算样本的原点矩。通常它的均值mean用 aaarticlea/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAAfABoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD7F/4YmsP+izfGr/wvbuj/AIYmsP8Aos3xq/8AC9u6+jWGQRkjPcV8Jz+IfH3w9/4KJaB8M9f+JXiW/wDh74n0aXU9EtpZYFYXKK5aCSVYgzKPIlIGQcPGCTzkWrSB6K56/wD8MTWH/RZvjV/4Xt3R/wA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WlQgjKsG7EYrF+B8upfAP4SePvE3xS8V6prnk+ItRkGq6ojSXT2MEv2S1RY1UZLrArBUX5mlJGd2TL8EfjN4B+JnxJu9UsdWk1jxxq9mIhaw2FysWladCWdYTI8ap9+TLsDl5HUDKomBb/ANdge39dz3HVpNH1iWfw1qIt7039lK02nToHWa2OI5NykYKneFIPXJ96/NLxXp3iX/glJ8bbbXdBa71v9nTxjfiO90p2Mj6TcEZIQn+NVBKN/wAtEQo3zIr19d+INN+Kem/tW3XjfSNDtdd+Hlr4fh8PXOmRX8cWoyTmQ3JuoEk2xFV3pGyvIhIyQDgZ4/8Aaa8Fax+254V0X4e6BpU+j+DzrEF94g8TalJADFDECfs9tCjtI0z7h8zKqKB1bOAle6a3/wCD/kN21T2/4B9Z2t1DfWsNzbyLLBMgkjkU5DKRkEexBqWoLGyg0yxt7O2jEVtbxrFFGOiqowB+AFT1TtfQlXtqf//Z" alt="" width="20" height="19" />时,通常用n-1为底。这样是想让结果跟接近总体的方差,又称为无偏估计)

3)让总体的原点矩与样本的原点矩相等,解出参数。所得结果即为参数的矩估计值。这里有,mean = E(x) = α / (α+β),var = D(x) = αβ / (α+β)2(α+β+1)。于是乎,我们可以求得α,β:

α = [mean*(1-mean)/var - 1] * mean

β = [mean*(1-mean)/var - 1] * (1-mean)

2. Fixed-point iteration

首先构造出似然函数,然后利用Fixed-point iteration来求得似然函数的最大值。

1)首先给出参数的一个初始值(通常可以使用矩估计得到的结果作为初始值)。

2)在初始值处,构造似然函数的一个紧的下界函数。这个下界函数可以求得其最大值处的闭式解,将此解作为新的估计用于下一次迭代中。

3)不断重复上述(2)的步骤,直至收敛。此时便可到达似然函数的stationary point。如果似然函数是convex的,那么此时就是唯一的最优解。

其实Fixed-point iteration的思想与EM类似。

首先给出两个不等式关系:

1)

2)

由此可以得到对数似然函数的一个下界:

想要得到此下界函数的最大值,可以分别对α,β求偏导,并令之等于零,此时便得到α和β各自的迭代公式:

由此,每次迭代,参数都会达到此次下界函数的最大值处,同时也就使得对应的似然函数值也相应地不断增大,直至收敛到似然函数的最大值处。

3. EM

通过将概率参数作为隐含变量,任何估计概率参数的算法都可以使用EM进一步变成估计个数参数的算法。

(1)E-step:计算出隐含变量p在已观测数据(观测到的每个类别发生的次数,以及每个类别的超参数值的上一轮迭代的取值)下的后验分布,便可以得到完全数据的对数似然函数的期望值。

(2)M-step:对E-step中的期望值求最大值,便可得到相应的超参数的本轮迭代的更新值。

(3)不断重复地运行E-step和M-step,直至收敛。

回来我们这里的问题上,在有了观测到的每个类别发生的次数,以及每个类别的超参数值的上一轮迭代的取值后,隐含变量p的后验分布为:

而此时的完全数据的对数似然函数的期望为:

其中,

于是乎,我们可以对完全数据的对数似然函数的期望求最大值,从而得到α,β的更新值,有很多方法,直接求偏导,梯度下降,牛顿法等。

但是呢,此时我们并不需要非常精确地求得它的最大值,而是仅仅用牛顿法迭代一次。相比于精确地求得最大值,这种方法在每次迭代时只有一半的计算量,但是迭代次数会超过两倍。

牛顿法的迭代可见:

3. 代码实现

 #!/usr/bin/python
# coding=utf-8 import numpy
import random
import scipy.special as special
import math
from math import log class HyperParam(object):
def __init__(self, alpha, beta):
self.alpha = alpha
self.beta = beta def sample_from_beta(self, alpha, beta, num, imp_upperbound):
sample = numpy.random.beta(alpha, beta, num)
I = []
C = []
for click_ratio in sample:
imp = random.random() * imp_upperbound
#imp = imp_upperbound
click = imp * click_ratio
I.append(imp)
C.append(click)
return I, C def update_from_data_by_FPI(self, tries, success, iter_num, epsilon):
'''estimate alpha, beta using fixed point iteration'''
for i in range(iter_num):
new_alpha, new_beta = self.__fixed_point_iteration(tries, success, self.alpha, self.beta)
if abs(new_alpha-self.alpha)<epsilon and abs(new_beta-self.beta)<epsilon:
break
self.alpha = new_alpha
self.beta = new_beta def __fixed_point_iteration(self, tries, success, alpha, beta):
'''fixed point iteration'''
sumfenzialpha = 0.0
sumfenzibeta = 0.0
sumfenmu = 0.0
for i in range(len(tries)):
sumfenzialpha += (special.digamma(success[i]+alpha) - special.digamma(alpha))
sumfenzibeta += (special.digamma(tries[i]-success[i]+beta) - special.digamma(beta))
sumfenmu += (special.digamma(tries[i]+alpha+beta) - special.digamma(alpha+beta)) return alpha*(sumfenzialpha/sumfenmu), beta*(sumfenzibeta/sumfenmu) def update_from_data_by_moment(self, tries, success):
'''estimate alpha, beta using moment estimation'''
mean, var = self.__compute_moment(tries, success)
#print 'mean and variance: ', mean, var
#self.alpha = mean*(mean*(1-mean)/(var+0.000001)-1)
self.alpha = (mean+0.000001) * ((mean+0.000001) * (1.000001 - mean) / (var+0.000001) - 1)
#self.beta = (1-mean)*(mean*(1-mean)/(var+0.000001)-1)
self.beta = (1.000001 - mean) * ((mean+0.000001) * (1.000001 - mean) / (var+0.000001) - 1) def __compute_moment(self, tries, success):
'''moment estimation'''
ctr_list = []
var = 0.0
for i in range(len(tries)):
ctr_list.append(float(success[i])/tries[i])
mean = sum(ctr_list)/len(ctr_list)
for ctr in ctr_list:
var += pow(ctr-mean, 2) return mean, var/(len(ctr_list)-1) def test():
hyper = HyperParam(1, 1)
#--------sample training data--------
I, C = hyper.sample_from_beta(10, 1000, 10000, 1000)
print I, C #--------estimate parameter using fixed-point iteration--------
hyper.update_from_data_by_FPI(I, C, 1000, 0.00000001)
print hyper.alpha, hyper.beta #--------estimate parameter using moment estimation--------
hyper.update_from_data_by_moment(I, C)
print hyper.alpha, hyper.beta

4. 参考文献

1. Click-Through Rate Estimation for Rare Events in Online Advertising

2. Estimating a Dirichlet distribution

版权声明:

本文由笨兔勿应所有,发布于http://www.cnblogs.com/bentuwuying。如果转载,请注明出处,在未经作者同意下将本文用于商业用途,将追究其法律责任。

CTR预估中的贝叶斯平滑方法(二)参数估计和代码实现的更多相关文章

  1. CTR预估中的贝叶斯平滑方法及其代码实现

    1. 背景介绍 广告形式: 互联网广告可以分为以下三种: 1)展示广告(display ad) 2)搜索广告(sponsored search ad) 3)上下文广告(contextual ad)   ...

  2. CTR预估中的贝叶斯平滑方法(一)原理及实验介绍

    1. 背景介绍 广告形式: 互联网广告可以分为以下三种: 1)展示广告(display ad) 2)搜索广告(sponsored search ad) 3)上下文广告(contextual ad)   ...

  3. 广告点击率 CTR预估中GBDT与LR融合方案

    http://www.cbdio.com/BigData/2015-08/27/content_3750170.htm 1.背景 CTR预估,广告点击率(Click-Through Rate Pred ...

  4. CTR预估中GBDT与LR融合方案(转载)

    1.背景 CTR预估,广告点击率(Click-Through Rate Prediction)是互联网计算广告中的关键环节,预估准确性直接影响公司广告收入.CTR预估中用的最多的模型是LR(Logis ...

  5. 第十三次作业——回归模型与房价预测&第十一次作业——sklearn中朴素贝叶斯模型及其应用&第七次作业——numpy统计分布显示

    第十三次作业——回归模型与房价预测 1. 导入boston房价数据集 2. 一元线性回归模型,建立一个变量与房价之间的预测模型,并图形化显示. 3. 多元线性回归模型,建立13个变量与房价之间的预测模 ...

  6. CTR预估中GBDT与LR融合方案

    1. 背景 CTR预估(Click-Through Rate Prediction)是互联网计算广告中的关键环节,预估准确性直接影响公司广告收入.CTR预估中用的最多的模型是LR(Logistic R ...

  7. 深度学习在CTR预估中的应用

    欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文由鹅厂优文发表于云+社区专栏 一.前言 二.深度学习模型 1. Factorization-machine(FM) FM = LR+ e ...

  8. NeurIPS 2018 中的贝叶斯研究

    NeurIPS 2018 中的贝叶斯研究 WBLUE 2018年12月21日   雷锋网 AI 科技评论按:神经信息处理系统大会(NeurIPS)是人工智能领域最知名的学术会议之一,NeurIPS 2 ...

  9. CTR的贝叶斯平滑

    参考论文: Click-Through Rate Estimation for Rare Events in Online Advertising 参考的博客: 1.https://jiayi797. ...

随机推荐

  1. JVM——深入分析对象的内存布局

    概述 一个对象本身的内在结构需要一种描述方式,这个描述信息是以字节码的方法存储在方法区中的.Class本身就是一个对象,都以KB为单位,如果new Integer()为了表示一个数据就占用KB级别的内 ...

  2. VUE2.0实现购物车和地址选配功能学习第二节

    第二节 创建VUE实例 购物车项目计划: 1.创建一个vue实例 2.通过v-for指令渲染产品数据 3.使用filter对金额和图片进行格式化 4.使用v-on实现产品金额动态计算 5.综合演示 ① ...

  3. connect函数的用法

    无论流式套接字(如TCP)还是数据报(如UDP),均可以使用connect函数.对于流式套接字,使用connect函数后,建立固定地址的连接,之后可以使用send/rev函数进行数据收发.对于数据报, ...

  4. Web平台安装及检测程序

    软件名称:microsoft web platform installer 上图: 可以看做是一个App Store, 你再也不用东奔西跑去找什么开发软件,CMS等等了,直接打开这个,勾选上就安装吧, ...

  5. JavaScript实现评论点赞功能

    通过分析评论功能的逻辑关系,学会如何使用JavaScript实现评论.回复.点赞等各种功能 1.学会JavaScript处理日期和时间. 2.掌握Dom操作中的添加/删除子节点方法. 3.使用setT ...

  6. Delete Node in a Linked List leetcode

    Write a function to delete a node (except the tail) in a singly linked list, given only access to th ...

  7. 2953: [Poi2002]商务旅行

    2953: [Poi2002]商务旅行 Time Limit: 3 Sec  Memory Limit: 128 MBSubmit: 8  Solved: 8[Submit][Status] Desc ...

  8. i++和++i 的学习

    在<<C++ Primer>> 第四版 5.5中讲解到: ++i:返回操作之后的结果,且是个左值. i++:返回操作之前的结果,且是有右值. // 2_3.cpp : 定义控制 ...

  9. JavaWeb之Servlet总结

    今天上班居然迟到了,昨天失眠了,看完吐槽大会实在不知道做些什么,刚好朋友给我发了两个JavaWeb的练习项目,自己就又研究了下,三四点才睡,可能周日白天睡的太多了,早上醒来已经九点多了,立马刷牙洗脸头 ...

  10. H5 音频

    HTML 5 音频 HTML5 视频/DOM HTML5 拖放 HTML5 提供了播放音频的标准. Web 上的音频 直到现在,仍然不存在一项旨在网页上播放音频的标准. 今天,大多数音频是通过插件(比 ...