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
b100f3c9
Commit
b100f3c9
authored
Feb 21, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
send_email
parent
b3cb69d6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
9 deletions
+23
-9
hypothesis_test.py
eda/recommended_indexs/hypothesis_test.py
+20
-6
send_email.py
eda/recommended_indexs/send_email.py
+3
-3
No files found.
eda/recommended_indexs/hypothesis_test.py
View file @
b100f3c9
...
...
@@ -53,6 +53,20 @@ def DATA_fixed(x,y,z,q):
where stat_date >='2018-11-17' and stat_date<='2018-11-26' group by stat_date"
.
format
(
x
,
y
,
z
,
q
)
CVR_DATA_fixed
=
con_sql
(
sql_cid
)
return
CVR_DATA_fixed
def
DATA_recently_all
(
x
,
y
,
z
,
q
,
m
,
t
):
ten_days
=
get_somedate
()
sql_cid
=
"select ({0}+{1})/{2} as {3} from {4}
\
where stat_date >='{5}' "
.
format
(
x
,
y
,
z
,
q
,
m
,
t
)
CVR_DATA_recently
=
con_sql
(
sql_cid
)
return
CVR_DATA_recently
#
# #获取固定时间的10天的数据
def
DATA_fixed_all
(
x
,
y
,
z
,
q
,
m
):
sql_cid
=
"select ({0}+{1})/{2} as {3} from {4}
\
where stat_date >='2018-11-17' and stat_date<='2018-11-26' group by stat_date"
.
format
(
x
,
y
,
z
,
q
,
m
)
CVR_DATA_fixed
=
con_sql
(
sql_cid
)
return
CVR_DATA_fixed
#
# #新用户cvr
x_crv_new_temp
=
DATA_recently
(
"diary_meigou_newUser"
,
"diary_clk_newUser"
,
"CVR_new"
,
"diary_meigou_crv"
,
ten_days
)
...
...
@@ -92,15 +106,15 @@ y_ctr_old_temp=DATA_fixed("clk_count_oldUser_all","imp_count_oldUser_all","ctr_o
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_temp
=
DATA_recently
(
"clk_count_newUser_all_a
"
,
"imp_count_newUser_all"
,
"ctr_new"
,
"on_click_diary_card"
,
ten_days
)
x_ctr_new_o_temp
=
DATA_recently
_all
(
"clk_count_newUser_all_a"
,
"clk_count_newUser_all_b
"
,
"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_temp
=
DATA_fixed
_all
(
"clk_count_newUser_all_a"
,
"clk_count_newUser_all_b
"
,
"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_temp
=
DATA_recently
(
"clk_count_oldUser_all_a
"
,
"imp_count_oldUser_all"
,
"ctr_old"
,
"on_click_diary_card"
,
ten_days
)
x_ctr_old_o_temp
=
DATA_recently
_all
(
"clk_count_oldUser_all_a"
,
"clk_count_oldUser_all_b
"
,
"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_temp
=
DATA_fixed
_all
(
"clk_count_oldUser_all_a"
,
"clk_count_oldUser_all_b
"
,
"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
))]
# #
#
...
...
@@ -158,10 +172,10 @@ print("【6】老用户CTR假设检验结果:")
ctr_old_ttest
=
t_test
(
x_ctr_old
,
y_ctr_old
)
#新用户ctr(on_click_diary_card)假设检验
print
(
"【7】新用户CTR假设检验(on_click_diary_card)结果:"
)
print
(
"【7】新用户CTR假设检验
(日记本列表ctr)
(on_click_diary_card)结果:"
)
ctr_new_o_ttest
=
t_test
(
x_ctr_new_o
,
y_ctr_new_o
)
#老用户ctr(on_click_diary_card)假设检验
print
(
"【8】老用户CTR假设检验(on_click_diary_card)结果:"
)
print
(
"【8】老用户CTR假设检验
(日记本列表ctr)
(on_click_diary_card)结果:"
)
ctr_old_o_ttest
=
t_test
(
x_ctr_old_o
,
y_ctr_old_o
)
#
# ###############推荐策略不变的情况下数据假设检验##############
...
...
eda/recommended_indexs/send_email.py
View file @
b100f3c9
...
...
@@ -10,8 +10,8 @@ import datetime
from
email.mime.multipart
import
MIMEMultipart
my_sender
=
'
gaoyazhe
@igengmei.com'
my_pass
=
'
VCrKTui99a7ALhiK
'
my_sender
=
'
wangzhiwei
@igengmei.com'
my_pass
=
'
RiKEcsHAgesCZ7yd
'
my_user1
=
'wangzhiwei@igengmei.com'
def
mail
():
ret
=
True
...
...
@@ -20,7 +20,7 @@ def mail():
pdfApart
.
add_header
(
'Content-Disposition'
,
'attachment'
,
filename
=
pdfFile
)
m
=
MIMEMultipart
()
m
.
attach
(
pdfApart
)
m
[
'Subject'
]
=
'
title
'
m
[
'Subject'
]
=
'
数据指标监控数据(假设检验)
'
try
:
...
...
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