python #추천시스템
-
잠재요인 협업필터링 추천시스템 구축Archive/통계&코딩이것저것 2021. 8. 23. 15:22
목적: 사용자가 등록한 채널에 따른 맞춤 SNS 추천 Input: data = pd.read_sql_query(query, con=conn) data['gudok']=1#등록 여부 df_user_channel=data.pivot_table('gudok',index='user_id',columns='channel_name').fillna(0) #pivot table을 만든다(중요) 잠재 요인 협업 필터링 사용자 - 아이템 평점 행렬 데이터만을 이용해 말 그대로 '잠재요인'을 끄집어 내는 것. '잠재요인'을 기반으로 사용자-아이템 행렬 데이터를 사용자 - 잠재요인 행렬과 아이템-잠재요인 행렬의 전치로 분해할 수 있으며, 이렇게 분해된 두 행렬의 내적을 통해 새로운 예측 사용자-아이템 평점 행렬 을 만들어서,..