Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
f2a8e925
Commit
f2a8e925
authored
Feb 19, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据指标波动假设检验统计
parent
fc956704
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
31 deletions
+43
-31
hypothesis_test.py
eda/recommended_indexs/hypothesis_test.py
+43
-31
No files found.
eda/recommended_indexs/hypothesis_test.py
View file @
f2a8e925
...
...
@@ -51,39 +51,51 @@ def DATA_fixed(x,y,z,q):
# #新用户cvr
x_crv_new_temp
=
DATA_recently
(
"diary_meigou_newUser"
,
"diary_clk_newUser"
,
"CVR_new"
,
"diary_meigou_crv"
,
ten_days
)
x_crv_new
=
[
float
(
str
(
Decimal
(
x_crv_new_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
x_crv_new_temp
))]
# print(type(x_crv_new))
# print(type(x_crv_new[0]))
y_crv_new_temp
=
DATA_fixed
(
"diary_meigou_newUser"
,
"diary_clk_newUser"
,
"CVR_new"
,
"diary_meigou_crv"
)
y_crv_new
=
[
float
(
str
(
Decimal
(
y_crv_new_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
y_crv_new_temp
))]
print
(
y_crv_new
)
# #老用户cvr
# x_crv_old=DATA_recently("diary_meigou_oldUser","diary_clk_oldUser","CVR_old","diary_meigou_crv")
# y_crv_old=DATA_fixed("diary_meigou_oldUser","diary_clk_oldUser","CVR_old","diary_meigou_crv")
x_crv_old_temp
=
DATA_recently
(
"diary_meigou_oldUser"
,
"diary_clk_oldUser"
,
"CVR_old"
,
"diary_meigou_crv"
,
ten_days
)
x_crv_old
=
[
float
(
str
(
Decimal
(
x_crv_old_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
x_crv_old_temp
))]
y_crv_old_temp
=
DATA_fixed
(
"diary_meigou_oldUser"
,
"diary_clk_oldUser"
,
"CVR_old"
,
"diary_meigou_crv"
)
y_crv_old
=
[
float
(
str
(
Decimal
(
y_crv_old_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
y_crv_old_temp
))]
#
# #新用户ct-cvr
# x_ctcrv_new=DATA_recently("diary_meigou_newUser","diary_exp_newUser","CT_CVR_new","diary_meigou_crv")
# y_ctcrv_new=DATA_fixed("diary_meigou_newUser","diary_exp_newUser","CT_CVR_new","diary_meigou_crv")
x_ctcrv_new_temp
=
DATA_recently
(
"diary_meigou_newUser"
,
"diary_exp_newUser"
,
"CT_CVR_new"
,
"diary_meigou_crv"
,
ten_days
)
x_ctcrv_new
=
[
float
(
str
(
Decimal
(
x_ctcrv_new_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
x_ctcrv_new_temp
))]
y_ctcrv_new_temp
=
DATA_fixed
(
"diary_meigou_newUser"
,
"diary_exp_newUser"
,
"CT_CVR_new"
,
"diary_meigou_crv"
)
y_ctcrv_new
=
[
float
(
str
(
Decimal
(
y_ctcrv_new_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
y_ctcrv_new_temp
))]
#
# #老用户ct-cvr
# x_ctcrv_old=DATA_recently("diary_meigou_oldUser","diary_exp_oldUser","CT_CVR_old","diary_meigou_crv")
# y_ctcrv_old=DATA_fixed("diary_meigou_oldUser","diary_exp_oldUser","CT_CVR_old","diary_meigou_crv")
x_ctcrv_old_temp
=
DATA_recently
(
"diary_meigou_oldUser"
,
"diary_exp_oldUser"
,
"CT_CVR_old"
,
"diary_meigou_crv"
,
ten_days
)
x_ctcrv_old
=
[
float
(
str
(
Decimal
(
x_ctcrv_old_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
x_ctcrv_old_temp
))]
y_ctcrv_old_temp
=
DATA_fixed
(
"diary_meigou_oldUser"
,
"diary_exp_oldUser"
,
"CT_CVR_old"
,
"diary_meigou_crv"
)
y_ctcrv_old
=
[
float
(
str
(
Decimal
(
y_ctcrv_old_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
y_ctcrv_old_temp
))]
#
# #新用户ctr(page_view)
# x_ctr_new=DATA_recently("clk_count_newUser_all","imp_count_newUser_all","ctr_new","bug_Recommendation_strategy_newUser")
# y_ctr_new=DATA_fixed("clk_count_newUser_all","imp_count_newUser_all","ctr_new","bug_Recommendation_strategy_newUser")
x_ctr_new_temp
=
DATA_recently
(
"clk_count_newUser_all"
,
"imp_count_newUser_all"
,
"ctr_new"
,
"bug_Recommendation_strategy_newUser"
,
ten_days
)
x_ctr_new
=
[
float
(
str
(
Decimal
(
x_ctr_new_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
x_ctr_new_temp
))]
y_ctr_new_temp
=
DATA_fixed
(
"clk_count_newUser_all"
,
"imp_count_newUser_all"
,
"ctr_new"
,
"bug_Recommendation_strategy_newUser"
)
y_ctr_new
=
[
float
(
str
(
Decimal
(
y_ctr_new_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
y_ctr_new_temp
))]
#
# #老用户ctr(page_view)
# x_ctr_old=DATA_recently("clk_count_oldUser_all","imp_count_oldUser_all","ctr_old","bug_Recommendation_strategy_temp")
# y_ctr_old=DATA_fixed("clk_count_oldUser_all","imp_count_oldUser_all","ctr_old","bug_Recommendation_strategy_temp")
x_ctr_old_temp
=
DATA_recently
(
"clk_count_oldUser_all"
,
"imp_count_oldUser_all"
,
"ctr_old"
,
"bug_Recommendation_strategy_temp"
,
ten_days
)
x_ctr_old
=
[
float
(
str
(
Decimal
(
x_ctr_old_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
x_ctr_old_temp
))]
y_ctr_old_temp
=
DATA_fixed
(
"clk_count_oldUser_all"
,
"imp_count_oldUser_all"
,
"ctr_old"
,
"bug_Recommendation_strategy_temp"
)
y_ctr_old
=
[
float
(
str
(
Decimal
(
y_ctr_old_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
y_ctr_old_temp
))]
#
# #新用户ctr(on_click_diary_card)
# x_ctr_new_o=DATA_recently("clk_count_newUser_all_a","imp_count_newUser_all","ctr_new","on_click_diary_card")
# y_ctr_new_o=DATA_fixed("clk_count_newUser_all_a","imp_count_newUser_all","ctr_new","on_click_diary_card")
x_ctr_new_o_temp
=
DATA_recently
(
"clk_count_newUser_all_a"
,
"imp_count_newUser_all"
,
"ctr_new"
,
"on_click_diary_card"
,
ten_days
)
x_ctr_new_o
=
[
float
(
str
(
Decimal
(
x_ctr_new_o_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
x_ctr_new_o_temp
))]
y_ctr_new_o_temp
=
DATA_fixed
(
"clk_count_newUser_all_a"
,
"imp_count_newUser_all"
,
"ctr_new"
,
"on_click_diary_card"
)
y_ctr_new_o
=
[
float
(
str
(
Decimal
(
y_ctr_new_o_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
y_ctr_new_o_temp
))]
#
# #老用户ctr(on_click_diary_card)
# x_ctr_old_o=DATA_recently("clk_count_oldUser_all_a","imp_count_oldUser_all","ctr_old","on_click_diary_card")
# y_ctr_old_o=DATA_fixed("clk_count_oldUser_all_a","imp_count_oldUser_all","ctr_old","on_click_diary_card")
#
x_ctr_old_o_temp
=
DATA_recently
(
"clk_count_oldUser_all_a"
,
"imp_count_oldUser_all"
,
"ctr_old"
,
"on_click_diary_card"
,
ten_days
)
x_ctr_old_o
=
[
float
(
str
(
Decimal
(
x_ctr_old_o_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
x_ctr_old_o_temp
))]
y_ctr_old_o_temp
=
DATA_fixed
(
"clk_count_oldUser_all_a"
,
"imp_count_oldUser_all"
,
"ctr_old"
,
"on_click_diary_card"
)
y_ctr_old_o
=
[
float
(
str
(
Decimal
(
y_ctr_old_o_temp
[
i
][
0
])
.
quantize
(
Decimal
(
'0.0000'
))))
for
i
in
range
(
len
(
y_ctr_old_o_temp
))]
#
#
#
...
...
@@ -116,23 +128,23 @@ def t_test(x,y): #进行t检验
#新用户cvr假设检验
crv_new_ttest
=
t_test
(
x_crv_new
,
y_crv_new
)
#老用户cvr假设检验
#
crv_old_ttest=t_test(x_crv_old,y_crv_old)
crv_old_ttest
=
t_test
(
x_crv_old
,
y_crv_old
)
#
#
#
新用户ct_cvr假设检验
#
ctcrv_new_ttest=t_test(x_ctcrv_new,y_ctcrv_new)
#新用户ct_cvr假设检验
ctcrv_new_ttest
=
t_test
(
x_ctcrv_new
,
y_ctcrv_new
)
# #老用户ct_cvr假设检验
#
ctcrv_old_ttest=t_test(x_ctcrv_old,y_ctcrv_old)
ctcrv_old_ttest
=
t_test
(
x_ctcrv_old
,
y_ctcrv_old
)
#
#
#
#
新用户ctr假设检验
#
ctr_new_ttest=t_test(x_ctr_new,y_ctr_new)
#
#
老用户ctr假设检验
#
ctr_old_ttest=t_test(x_ctr_old,y_ctr_old)
#
#
#
#新用户ctr(on_click_diary_card)假设检验
#
ctr_new_o_ttest=t_test(x_ctr_new_o,y_ctr_new_o)
#
#
老用户ctr(on_click_diary_card)假设检验
#
ctr_old_o_ttest=t_test(x_ctr_old_o,y_ctr_old_o)
#新用户ctr假设检验
ctr_new_ttest
=
t_test
(
x_ctr_new
,
y_ctr_new
)
#老用户ctr假设检验
ctr_old_ttest
=
t_test
(
x_ctr_old
,
y_ctr_old
)
##新用户ctr(on_click_diary_card)假设检验
ctr_new_o_ttest
=
t_test
(
x_ctr_new_o
,
y_ctr_new_o
)
#老用户ctr(on_click_diary_card)假设检验
ctr_old_o_ttest
=
t_test
(
x_ctr_old_o
,
y_ctr_old_o
)
#
#
# ###############推荐策略不变的情况下数据假设检验##############
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment