Commit 0a9e61a0 authored by 王志伟's avatar 王志伟

send_email

parent a88e726e
......@@ -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)
......
......@@ -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'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment