click through rate prediction
来源:互联网 发布:娜迦皇家卫兵知乎 编辑:程序博客网 时间:2024/04/30 13:52
click through rate prediction
包括内容如下图:
使用直接估计法,置信区间置信率的估计:
1.使用二项分布直接估计
1
2
3
4
5
6
low
=
ceil(n
*
0.04
);
%
上取整
high
=
floor(n
*
0.06
);
%
下取整
prob
=
0
;
for
i
=
low:
1
:high
prob
=
prob
+
nchoosek(n,i)
*
(
0.05
^i)
*
(
0.95
^(n
-
i));
end
2.使用正态分布近似
1
normcdf(
0.06
,
0.05
,sigma
/
x(i)^
0.5
)
-
normcdf(
0.04
,
0.05
,sigma
/
x(i)^
0.5
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
warning off
all
;
clear
all
;clc;close
all
;
x
=
500
:
1
:
1500
;
y
=
zeros(
1
,size(x,
2
));
y2
=
zeros(
1
,size(x,
2
));
sigma
=
sqrt(
0.05
*
0.95
);
for
i
=
1
:size(x,
2
)
y(i)
=
adPredict(x(i));
y2(i)
=
normcdf(
0.06
,
0.05
,sigma
/
x(i)^
0.5
)
-
normcdf(
0.04
,
0.05
,sigma
/
x(i)^
0.5
);
end
plot(x,y,
'b-'
); hold on;
plot(x,y2,
'r-'
);
hold on;
x1
=
[
500
1500
];
y1
=
[
0.85
0.85
];
plot(x1,y1,
'y-'
);
打印曲线:观测到,n=1000,差不多置信度会到达0.85
AUC概念及计算:
sklearn代码:sklearn中有现成方法,计算一组TPR,FPR,然后plot就可以;AUC也可以直接调用方法。
import numpy as npimport matplotlib.pyplot as pltfrom sklearn.linear_model import LogisticRegressionfrom sklearn import datasetsfrom sklearn.preprocessing import StandardScalerfrom sklearn.metrics import roc_auc_scorefrom sklearn.metrics import roc_curvedigits = datasets.load_digits()X, y = digits.data, digits.targetX = StandardScaler().fit_transform(X)# classify small against large digitsy = (y > 4).astype(np.int)X_train = X[:-400]y_train = y[:-400]X_test = X[-400:]y_test = y[-400:]lrg = LogisticRegression(penalty='l1')lrg.fit(X_train, y_train)y_test_prob=lrg.predict_proba(X_test)P = np.where(y_test==1)[0].shape[0];N = np.where(y_test==0)[0].shape[0];dt = 10001TPR = np.zeros((dt,1))FPR = np.zeros((dt,1))for i in range(dt): y_test_p = y_test_prob[:,1]>=i*(1.0/(dt-1)) TP = np.where((y_test==1)&(y_test_p==True))[0].shape[0]; FN = P-TP; FP = np.where((y_test==0)&(y_test_p==True))[0].shape[0]; TN = N - FP; TPR[i]=TP*1.0/P FPR[i]=FP*1.0/Nplt.plot(FPR,TPR,color='black')plt.plot(np.array([[0],[1]]),np.array([[0],[1]]),color='red')plt.show()#use sklearn method# fpr, tpr, thresholds = roc_curve(y_test,y_test_prob[:,1],pos_label=1)# plt.plot(fpr,tpr,color='black')# plt.plot(np.array([[0],[1]]),np.array([[0],[1]]),color='red')# plt.show()rank = y_test_prob[:,1].argsort()rank = rank.argsort()+1auc = (sum(rank[np.where(y_test==1)[0]])-(P*1.0*(P+1)/2))/(P*N);print aucprint roc_auc_score(y_test, y_test_prob[:,1])
0 0
- click through rate prediction
- click through rate prediction
- [pySpark][note]Click-Through Rate Prediction
- 可扩展机器学习——分类——点击率预测(Click-through Rate Prediction)
- Kaggle[2] - Predict the click through rate (KDD12 trackl2)
- 【点击模型学习笔记】Predicting Clicks_Estimating the Click-Through Rate for New Ads_MS_www2007
- Automatic Query Type Identification Based on Click Through Information
- Automatic Search Engine Performance Evaluation with Click-through Data Analysis
- 【Android学习笔记】 点击穿透(Click Through)
- 《Android笔记》禁止点击穿透(Click Through)
- 【每周一文】Ad Click Prediction: a View from the Trenches(2013)
- 【点击模型学习笔记】Ad centric model discovery for redicting ads' click through rate_ANT2013_Tencent
- Kaggle上关于Predict click-through rates on display ads的经典探讨,主要关于特征处理的技巧
- bit rate / frame rate /sample rate等等
- bit rate / frame rate /sample rate等等
- bit rate / frame rate /sample rate等等
- Game Prediction
- Game Prediction
- 数据库DDL语句 创建表
- 小希益公益APP走进法大校园,推进校园公益活动
- HDU-5862-Counting Intersections(树状数组+离散化+扫描线)
- AbstractQueuedSynchronizer的介绍和原理分析
- 经典算法,复古算法
- click through rate prediction
- Android 之adapter
- php post提交json如何获取
- 图解MySql命令行创建存储过程
- Kali Linux的安装
- ubuntu下安装vftp 安装vsftpd提示530 Login incorrect
- 使用requests模拟登陆github
- Opencv2.4.9源码分析——Expectation Maximization
- 车牌摇号 程序设计题