资源下载地址:https://download.csdn.net/download/sheziqiong/85676911

广告自动调价算法介绍

1:Bid 的自动出价算法

2:Weight 的自动调优算法

1:Bid 的自动出价算法介绍

原理:我们希望最大化 revenue 最小化 cost,但是业务员只能调整 bid,budget 和 weight,由于 SQL 里面目前还无法查询出 bid 和 revenue 之间对应到 trigger 的对应关系,我暂时先把 cpc 近似当成 bid,然后找 cpc 和 profit(之所以此处没有用 revenue,是因为要让 revenue 最大化不可能不考虑 cost,如果把成本考虑进来,最大化 revenue 更实际的情况是提高收益率 profit,另外,此处没有选择提高 ctr 是因为提高 ctr 的做法放在优化 weight 上了)之间的关系。见图 1,从图上看深度神经网络是能找到他们之间的有效相关性,

数据:分别抽取 cpc 和盈利 profit 之间的对应数据,以及 cpc 和亏损 profit 之间的对应数据。

算法:用 GAN 算法分别生成盈利 profit 对应的 bid_g 和亏损 profit 对应的 bid_b。

其中 bid 的生成范围在 0.05-3 之间。

D_loss = - torch.mean(torch.log(prob_artist0) + torch.log(1. - prob_artist1))  #最大化profit函数
         G_loss = -torch.mean(torch.log(1. - prob_artist1))   #最小化bid函数

bid 自动调价规则

如果 bid_g - bid_b > 0,那么当前的 bid 能调整的幅度范围就是:bid + bid_g - bid_b。

如果 bid_g - bid_b < 0,那么当前的 bid 能调整的幅度范围就是:bid - bid_g - bid_b。

模型源码及模型部署

模型源码 auto-bid.py(文件我放在 192.168.101.70 的 autobid 目录下)

模型完整运行一次耗时 35 个小时,导入数据 62 万。

在这里插入图片描述

模型文件 autobidg.model.meta 和 autobidb.model.meta 部署在 autobid/module 下,这 2 个模型分别耗时 35 小时和 68 小时,是所有盈利数据和所有亏损数据进去后计算出来的。下一步想把 bid,budget 和 weight 合在一起出 2 个模型就够了,目前是分开的,不过调用的时候其实不用管模型部署文件,都已经直接写到程序里面了。

自动调价的计算和更新 bid 步骤:

:每天在收到收入报告后,在导入 adm 之后,运行程序 autobid.py。

:自动调价 bid 的输出分为 2 个文件,每个文件 2 列,见下表

:用 good 的价格减去对应 trigger 的 bad 价格就是每天需要调整的 bid 范围,然后根据自动调价规则来更新 bid 价格。

Weight 的自动调优算法

:理论上我们应该是谁的转换率高我们给的权重就多,但是我们的 Weight 是在 ad-page 上统计的,每个 ad-page 对应多个 trigger。所以在计算转换率的时候我是用 revenue 的 click 除以 cost 的 click,然后用 GAN 算法不断拟合 weight 到转换率的关系。简单说是最大化 revenue 的 ctr,最小化 cost 的 click。剩下的工作就跟上面一样了,但只产生一个模型。

自动调优 weight 的计算和更新 weight 步骤:

:每天在收到收入报告后,在导入 adm 之后,调整参数 reportdate 的日期为收到报告的日期,然后运行程序 autoweight.py。

:自动调价 weight 的输出只有一个文件 weight**.txt(**是日期),见下表

trigger_words platform id_adpages id_linkpair id_account id_trigger_words Weight 建议值
lowering ldl cholesterol inuvo_lexo 1230846 302984 1324 1 15.223612
lowering ldl cholesterol inuvo_lexo 1123574 320956 1324 1 14.490099
lowering ldl cholesterol inuvo_lexo 1168406 333796 1324 1 2.878565
lowering ldl cholesterol inuvo_lexo 1219862 307416 1324 1 25.285267
lowering ldl cholesterol inuvoreal 637346 190224 1016 1 27.708143
lowering ldl cholesterol inuvo_lexo 920846 266974 208 1 28.100786
lowering ldl cholesterol inuvo_lexo 1232120 351384 228 1 25.049885
atopic dermatitis inuvoreal 493436 148438 381 2 13.623442
atopic dermatitis inuvo_lexo 1274066 365812 802 2 16.44322
atopic dermatitis parked 1026562 294370 310 2 18.391785
atopic dermatitis inuvoreal 1253692 221414 962 2 9.028065
atopic dermatitis inuvoreal 1244370 165926 962 2 29.078337
atopic dermatitis inuvoreal 1257782 185636 962 2 8.735622
atopic dermatitis inuvoreal 1273000 365604 145 2 16.769901
atopic dermatitis inuvoreal 1273090 365608 145 2 17.396612
atopic dermatitis inuvoreal 1269354 364070 1104 2 8.085274
atopic dermatitis inuvoreal 1269488 364108 1104 2 24.298153
atopic dermatitis inuvo_lexo 1265226 354156 928 2 14.363249
atopic dermatitis inuvo_lexo 1273738 349490 928 2 11.722599

:如果 weight 的值小于 0 代表不建议分流量到该 trigger 上,另外,weight 的小数点可以省去。具体在哪个页面调整,看 trigger 对应的 id_adpages 及相应的账户 id_account。这还需要技术部的支持把每个 trigger 对应到的账户和 adpage 分配下去。业务员根据自动调优的 weight 建议值调整 weight。

模型源码

自动调优的源码 autoweight.py(文件我放在 192.168.101.70 的 autobid 目录下)

如果需要看模型效果把注释去掉就能看到:

# if step % 50 == 0:
#     #print('D_loss', "%.6f"%D_loss.data)
#     # print('G_loss', G_loss)
#     # print("\n")
# File.write(str("%.6f"%D_loss.data)+" ,"+str("%.6f"%G_loss.data) + "\n")

资源下载地址:https://download.csdn.net/download/sheziqiong/85676911

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐