总评级修改
This commit is contained in:
@@ -124,13 +124,15 @@ def calc_consumption_rating(community_summary_df):
|
|||||||
actions = list()
|
actions = list()
|
||||||
count = 0
|
count = 0
|
||||||
|
|
||||||
if len(df) < 5:
|
# 总评级
|
||||||
|
total_rate = 6
|
||||||
|
if len(df) < total_rate:
|
||||||
# 对于样本低于5的直接排名
|
# 对于样本低于5的直接排名
|
||||||
df[target] = df['consumption_potential'].rank(method='dense', ascending=False).astype(int)
|
df[target] = df['consumption_potential'].rank(method='dense', ascending=False).astype(int)
|
||||||
else:
|
else:
|
||||||
# 极值设置
|
# 极值设置
|
||||||
df = filter_min_max(df)
|
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():
|
for index, item in df.iterrows():
|
||||||
row = dict()
|
row = dict()
|
||||||
|
|||||||
Reference in New Issue
Block a user