|
@@ -149,7 +149,7 @@ def rank_for_layer1(run_dt, run_hour, project, table, gh_df):
|
|
np.random.seed(int(dt_version) + 1)
|
|
np.random.seed(int(dt_version) + 1)
|
|
|
|
|
|
# TODO: 修改权重计算策略
|
|
# TODO: 修改权重计算策略
|
|
- df['score'] = df['ros']
|
|
|
|
|
|
+ df['score'] = 1.0
|
|
# 按照 category1 分类后进行加权随机抽样
|
|
# 按照 category1 分类后进行加权随机抽样
|
|
sampled_df = df.groupby('category1').apply(
|
|
sampled_df = df.groupby('category1').apply(
|
|
lambda x: x.sample(n=SEND_N, weights=x['score'], replace=False)).reset_index(drop=True)
|
|
lambda x: x.sample(n=SEND_N, weights=x['score'], replace=False)).reset_index(drop=True)
|