总评级修改

This commit is contained in:
sjshenjian
2024-07-09 15:39:34 +08:00
parent 5fdb0ac7ce
commit 8c5b16e519
@@ -124,13 +124,15 @@ def calc_consumption_rating(community_summary_df):
actions = list()
count = 0
if len(df) < 5:
# 总评级
total_rate = 6
if len(df) < total_rate:
# 对于样本低于5的直接排名
df[target] = df['consumption_potential'].rank(method='dense', ascending=False).astype(int)
else:
# 极值设置
df = filter_min_max(df)
df = gmm_train(5, df, source, target)
df = gmm_train(total_rate, df, source, target)
# 批量更新
for index, item in df.iterrows():
row = dict()