Commit f1f0bbbf authored by mxx's avatar mxx

1

parent 18dbee01
This diff is collapsed.
...@@ -179,7 +179,7 @@ for i in pre_slotad_cvr_good_old.index: ...@@ -179,7 +179,7 @@ for i in pre_slotad_cvr_good_old.index:
key = pre_slotad_cvr_good_old.ix[i, 'key'] key = pre_slotad_cvr_good_old.ix[i, 'key']
value = pre_slotad_cvr_good_old.ix[i, 'value'] value = pre_slotad_cvr_good_old.ix[i, 'value']
pipe.set(key, value, ex=200) pipe.set(key, value, ex=200)
if i % 2000 == 0: if i % 5000 == 0:
pipe.execute() pipe.execute()
print(i) print(i)
time.sleep(0.5) time.sleep(0.5)
...@@ -189,8 +189,8 @@ pipe.execute() ...@@ -189,8 +189,8 @@ pipe.execute()
for i in pre_slotad_cvr_good.index: for i in pre_slotad_cvr_good.index:
key = pre_slotad_cvr_good.ix[i, 'key'] key = pre_slotad_cvr_good.ix[i, 'key']
value = pre_slotad_cvr_good.ix[i, 'value'] value = pre_slotad_cvr_good.ix[i, 'value']
pipe.set(key, value, ex=90000) pipe.set(key, value, ex=432000)
if i % 2000 == 0: if i % 5000 == 0:
pipe.execute() pipe.execute()
print(i) print(i)
time.sleep(0.5) time.sleep(0.5)
...@@ -288,7 +288,7 @@ stat_slotad_cvr_good_old.to_csv('stat_slotad_cvr_good_old.csv', index=False) ...@@ -288,7 +288,7 @@ stat_slotad_cvr_good_old.to_csv('stat_slotad_cvr_good_old.csv', index=False)
for i in stat_slotad_cvr_good_old.index: for i in stat_slotad_cvr_good_old.index:
key = stat_slotad_cvr_good_old.ix[i, 'key'] key = stat_slotad_cvr_good_old.ix[i, 'key']
value = stat_slotad_cvr_good_old.ix[i, 'value'] value = stat_slotad_cvr_good_old.ix[i, 'value']
pipe.set(key, value, ex=200) pipe.set(key, value, ex=600)
if i % 2000 == 0: if i % 2000 == 0:
pipe.execute() pipe.execute()
print(i) print(i)
...@@ -299,7 +299,7 @@ pipe.execute() ...@@ -299,7 +299,7 @@ pipe.execute()
for i in stat_slotad_cvr_good.index: for i in stat_slotad_cvr_good.index:
key = stat_slotad_cvr_good.ix[i, 'key'] key = stat_slotad_cvr_good.ix[i, 'key']
value = stat_slotad_cvr_good.ix[i, 'value'] value = stat_slotad_cvr_good.ix[i, 'value']
pipe.set(key, value, ex=187200) pipe.set(key, value, ex=432000)
if i % 5000 == 0: if i % 5000 == 0:
pipe.execute() pipe.execute()
print(i) print(i)
......
import redis import redis
import json import json
params_dict={ params_dict={
#recommend方法 "feedBackParams": {
'startFacter':0.5,'cpaBiasRatioFacter':1.0, "bOrientConfidenceFactor1": 1,
'cpaOrientRatioFacter':0.5, "bOrientConfidenceFactor2": 1,
'cpaBiasThresholdFacter':2.0, "bOrientCostConvertBiasFactor1": 1.2,
'cpcTargetRatioFacter':0.5, "bOrientCostConvertBiasFactor2": 1.5,
'cpcOrientRatioFacter':0.01, "bSlotOrientRadioFactor2": 2,
'cpcBiasThresholdFacter':1.0, "bSlotOrientationConfidenceFactor1": 0.5,
"bSlotOrientationConfidenceFactor2": 0.5,
#熔断 "bSlotOrientationCostConvertBiasFactor1": 3.5,
'fuseOrientCostG1dFacter':50000.0, "fuseOrientCostConvertBiasFactor": 2,
'fuseOrientCostConvertbiasFacter':2.0, "fuseOrientCostG1dFactor": 50000,
#白名单参数 "wSlotOrientationConfidenceFactor": 0.2,
'wSlotOrientationConfidenceFacter':0.2, "wSlotOrientationCostConvertBiasFactor": 1.2
'wSlotOrientationCostConvertBiasFacter':1.2, },
#高置信黑名单参数 "slotRecommendParams": {
'bOrientConfidenceFacter1':1.0, "cpaBiasRatioFactor": 1,
'bOrientCostConvertbiasFacter1':1.2, "cpaBiasThresholdFactor": 2,
'bSlotOrientationConfidenceFacter1':0.5, "cpaOrientRatioFactor": 0.6,
'bSlotOrientationCostConvertBiasFacter1':3.5, "cpcBiasThresholdFactor": 1,
#低置信黑名单参数 "cpcOrientRatioFactor": 0.1,
'bOrientConfidenceFacter2':1.0, "cpcTargetRatioFactor": 0.5,
'bOrientCostConvertbiasFacter2':1.5, "startFactor": 0.5
'bSlotOrientationConfidenceFacter2':0.5, }
'bSlotOrientRadioFacter2':2.0,
} }
params_key="NZ_K86_trusteeship_params"
params_key="NZ_K??_auto_manage_params"
params_value=json.dumps(params_dict) params_value=json.dumps(params_dict)
pool = redis.ConnectionPool(host='r-bp18da0abeaddc94285.redis.rds.aliyuncs.com',
password='hteK73Zxx3ji9LGCy2jBAZDJ6', port=6379, db=0)
r = redis.Redis(connection_pool=pool)
r.set(params_key,params_value)
\ No newline at end of file
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