架设要给用户推荐套餐,可以根据一下方法现进行分析:
**召回算法:**分类、聚类、协调过滤、知识图谱
字符串标签化
def discrete(col):
# job value_counts() (a,b,c) 三个
a = pd.DataFrame(col.value_counts()).reset_index()
b = a['index'].to_dict()
c = dict(zip(b.values(), b.keys()))
print(c)
return c月份转换对应数值
def month_to_int(col):
mon_dict={'jan':1,'feb':2,'mar':3,'apr':4,'may':5,'jun':6,'jul':7,'aug':8,'sep':9,'oct':10,'nov':11,'dec':12}
col=col.map(mon_dict)
return col