# 用户行为置换成数字 可用来设置计算总评分或惩罚项 features.loc[features['behavior_type']=='clk','behavior_type'] = 1 features.loc[features['behavior_type']=='cart','behavior_type'] = -0.5 features.loc[features['behavior_type']=='collect','behavior_type'] = 3 features.loc[features['behavior_type']=='buy','behavior_type'] = -5