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
0a9e61a0
Commit
0a9e61a0
authored
Feb 21, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
send_email
parent
a88e726e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
hypothesis_test.py
eda/recommended_indexs/hypothesis_test.py
+6
-7
send_email.py
eda/recommended_indexs/send_email.py
+2
-0
No files found.
eda/recommended_indexs/hypothesis_test.py
View file @
0a9e61a0
...
...
@@ -10,7 +10,6 @@ import smtplib
from
email.mime.text
import
MIMEText
from
email.utils
import
formataddr
f
=
open
(
'/srv/apps/ffm-baseline/eda/recommended_indexs/test.txt'
,
'w'
)
#########推荐策略前后统计指标假设检验(t检验)###############
...
...
@@ -131,20 +130,20 @@ def t_test(x,y): #进行t检验
t_p_value
=
t_test
[
1
]
# print(t_p_value)
if
t_p_value
>
0.05
:
print
(
"95
%
置信度认为策略前后两组数据
无显著性差异
,即该指标没有显著提升,p_value:{}"
.
format
(
t_p_value
))
print
(
"95
%
置信度认为策略前后两组数据
【无显著性差异】
,即该指标没有显著提升,p_value:{}"
.
format
(
t_p_value
))
print
(
"
\n
"
)
else
:
print
(
"95
%
置信度认为策略前后两组数据
有显著性差异
,即该指标获得显著提升,p_value:{}"
.
format
(
t_p_value
))
print
(
"95
%
置信度认为策略前后两组数据
【有显著性差异】
,即该指标获得显著提升,p_value:{}"
.
format
(
t_p_value
))
print
(
"
\n
"
)
else
:
#认为数据方差不具有齐性,equal_var=false
t_test
=
ttest_ind
(
x
,
y
,
equal_var
=
False
)
t_p_value
=
t_test
[
1
]
# print(t_p_value)
if
t_p_value
>
0.05
:
print
(
"95
%
置信度认为策略前后两组数据
无显著性差异
,即该指标没有显著提升,p_value:{}"
.
format
(
t_p_value
))
print
(
"95
%
置信度认为策略前后两组数据
【无显著性差异】
,即该指标没有显著提升,p_value:{}"
.
format
(
t_p_value
))
print
(
"
\n
"
)
else
:
print
(
"95
%
置信度认为策略前后两组数据
有显著性差异
,即该指标获得显著提升,p_value:{}"
.
format
(
t_p_value
))
print
(
"95
%
置信度认为策略前后两组数据
【有显著性差异】
,即该指标获得显著提升,p_value:{}"
.
format
(
t_p_value
))
print
(
"
\n
"
)
#
# ###假设检验,判断是否具有显著性
...
...
@@ -257,7 +256,7 @@ def chi_cal(data):
print
(
"
\n
"
)
#老用户精准点击曝光数据(首页精选日记本列表on_click_diary_card)
print
(
"【1】(精准曝光)首页精选日记本列表老用户
ctr
数据波动假设检验结果:"
)
print
(
"【1】(精准曝光)首页精选日记本列表老用户
CTR
数据波动假设检验结果:"
)
chi_ctr_precise_old_recently
=
chi_DATA_recently
(
"clk_count_oldUser_all_a"
,
"clk_count_oldUser_all_b"
,
"imp_count_oldUser_all_precise"
,
"on_click_diary_card"
,
five_days
,
yesterday
)
temp1_old
=
[
float
(
str
(
Decimal
(
chi_ctr_precise_old_recently
[
i
])
.
quantize
(
Decimal
(
'0.0'
))))
for
i
in
range
(
len
(
chi_ctr_precise_old_recently
))]
# print(temp1)
...
...
@@ -268,7 +267,7 @@ ctr_tst_old=data_cal(temp1_old,temp2_old)
chi_cal
(
ctr_tst_old
)
#新用户精准点击曝光数据(首页精选日记本列表on_click_diary_card)
print
(
"【2】(精准曝光)首页精选日记本列表新用户
ctr
数据波动假设检验结果:"
)
print
(
"【2】(精准曝光)首页精选日记本列表新用户
CTR
数据波动假设检验结果:"
)
chi_ctr_precise_new_recently
=
chi_DATA_recently
(
"clk_count_newUser_all_a"
,
"clk_count_newUser_all_b"
,
"imp_count_newUser_all_precise"
,
"on_click_diary_card"
,
five_days
,
yesterday
)
temp1_new
=
[
float
(
str
(
Decimal
(
chi_ctr_precise_new_recently
[
i
])
.
quantize
(
Decimal
(
'0.0'
))))
for
i
in
range
(
len
(
chi_ctr_precise_new_recently
))]
# print(temp1)
...
...
eda/recommended_indexs/send_email.py
View file @
0a9e61a0
...
...
@@ -13,6 +13,8 @@ from email.mime.multipart import MIMEMultipart
my_sender
=
'wangzhiwei@igengmei.com'
my_pass
=
'RiKEcsHAgesCZ7yd'
my_user1
=
'wangzhiwei@igengmei.com'
my_user2
=
'gaoyazhe@igengmei.com'
my_user3
=
'huangkai@igengmei.com'
def
mail
():
ret
=
True
pdfFile
=
'hypothesis.txt'
...
...
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