資源簡介
基于用戶的協(xié)同過濾和基于內(nèi)容的混合推薦系統(tǒng)源代碼.基于內(nèi)容的推薦算法的具體實(shí)現(xiàn)+基于用戶的協(xié)同過濾算法的具體實(shí)現(xiàn) 網(wǎng)上下載的,使用python語言來進(jìn)行編寫
代碼片段和文件信息
#?代碼說明:
#?基于內(nèi)容的推薦算法的具體實(shí)現(xiàn)
import?math
import?numpy?as?np
import?pandas?as?pd
#?創(chuàng)建節(jié)目畫像
#?參數(shù)說明:
#?items_profiles?=?{item1:{‘label1‘:1?‘label2‘:?0?‘label3‘:?0?...}?item2:{...}...}
def?createItemsProfiles(data_array?labels_names?items_names):
????items_profiles?=?{}
????for?i?in?range(len(items_names)):
????????items_profiles[items_names[i]]?=?{}
????????for?j?in?range(len(labels_names)):
????????????items_profiles[items_names[i]][labels_names[j]]?=?data_array[i][j]
????return?items_profiles
#?創(chuàng)建用戶畫像
#?參數(shù)說明:
#?data_array:?所有用戶對于其所看過的節(jié)目的評分矩陣?data_array?=?[[2?0?0?1.1?...]?[0?0?1.1?...]?...]
#?users_profiles?=?{user1:{‘label1‘:1.1?‘label2‘:?0.5?‘label3‘:?0.0?...}?user2:{...}...}
def?createUsersProfiles(data_array?users_names?items_names?labe
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-05-02?21:57??recommender_system\
?????文件????????8592??2018-05-02?12:51??recommender_system\CB.py
?????文件????????4849??2018-05-02?21:27??recommender_system\CB_Mixture_userCF.py
?????文件????????7586??2018-05-02?19:53??recommender_system\UserCF.py
?????目錄???????????0??2018-05-02?21:57??recommender_system\__pycache__\
?????文件????????3686??2018-05-02?20:13??recommender_system\__pycache__\CB.cpython-36.pyc
?????文件????????3648??2018-05-02?20:13??recommender_system\__pycache__\UserCF.cpython-36.pyc
?????文件????????1841??2018-05-02?00:36??recommender_system\items_labels_to_01matrix.py
?????文件????????2230??2018-05-02?11:31??recommender_system\items_saw_labels_to_01matrix.py
評論
共有 條評論