新增评级总分100
This commit is contained in:
@@ -127,7 +127,7 @@ def calc_consumption_rating(community_summary_df):
|
||||
count = 0
|
||||
|
||||
# 总评级
|
||||
total_rate = 100
|
||||
total_rate = 6
|
||||
if len(df) < total_rate:
|
||||
# 对于样本低于5的直接排名
|
||||
df[target] = df['consumption_potential'].rank(method='dense', ascending=False).astype(int)
|
||||
@@ -144,11 +144,23 @@ def calc_consumption_rating(community_summary_df):
|
||||
df = gmm_train(total_rate, df, "estate_charge_score", "estate_charge_rating")
|
||||
df = gmm_train(total_rate, df, "relative_price_ranking_score", "relative_price_rating")
|
||||
df = gmm_train(total_rate, df, "avg_cost_score", "avg_cost_rating")
|
||||
|
||||
# 总分数
|
||||
total_score = 100
|
||||
if len(df) < total_score:
|
||||
# 对于样本低于5的直接排名
|
||||
df["consumption_score"] = df['consumption_potential'].rank(method='dense', ascending=False).astype(int)
|
||||
else:
|
||||
# 极值设置
|
||||
df = filter_min_max(df)
|
||||
df = gmm_train(total_rate, df, source, "consumption_score")
|
||||
|
||||
# 批量更新
|
||||
for index, item in df.iterrows():
|
||||
row = dict()
|
||||
_id = str(item["_id"])
|
||||
row['consumption_rating'] = item['consumption_rating']
|
||||
row['consumption_score'] = item['consumption_score']
|
||||
row['consumption_potential'] = item['consumption_potential']
|
||||
row['m_date'] = dateutils.iso_format()
|
||||
row['sub_factor'] = {
|
||||
|
||||
Reference in New Issue
Block a user