【Python推薦系統(tǒng)框架(TensorFlow支持)】 RecQ: A Python Framework for Recommender Systems (TensorFlow Supported) by Coder-Yu 項(xiàng)目地址:(注:請點(diǎn)擊文末【閱讀原文】訪問劃線鏈接) 最新消息我們現(xiàn)在將RecQ轉(zhuǎn)移到TensorFlow。 未來幾周將提供基于GPU的版本。 10/09/2018 - 基于對抗訓(xùn)練的模型:APR已經(jīng)實(shí)施。 10/02/2018 - 兩個(gè)深度模型:DMF、CDAE已經(jīng)實(shí)施。 07/12/2018 - TensorFlow支持的算法:BasicMF,PMF,SVD,EE(實(shí)現(xiàn)中......) 介紹創(chuàng)建者: @Coder-Yu 主要貢獻(xiàn)者:@DouTong @Niki666 @HuXiLiFeng @BigPowerZ @flyxu 由重慶大學(xué)軟件工程學(xué)院發(fā)布 更多算法(基于排名和上下文感知)可以在我的另一個(gè)項(xiàng)目 Yue 中找到 RecQ 是用于推薦系統(tǒng)的Python庫(Python 2.7.x)。 它實(shí)現(xiàn)了一系列最先進(jìn)的建議。 為了輕松運(yùn)行RecQ(無需逐個(gè)設(shè)置RecQ中使用的軟件包),強(qiáng)烈建議使用領(lǐng)先的開放數(shù)據(jù)科學(xué)平臺 Anaconda。 它集成了Python解釋器,常見科學(xué)計(jì)算庫(如Numpy,Pandas和Matplotlib)以及包管理器,所有這些都使它成為數(shù)據(jù)科學(xué)研究人員的完美工具。 RecQ的架構(gòu)特性
1.將 **xx.conf** 文件配置在名為config的目錄中。 (xx是你要運(yùn)行的算法的名稱) 2.運(yùn)行項(xiàng)目中的 **main.py** ,然后在提示后輸入。 如何配置
設(shè)置輸入數(shù)據(jù)集的路徑。 格式:每行用空、制表符或逗號符號分隔。socialD:/MovieLens/trusts.txtSet the path to input social dataset. Format: each row separated by empty, tab or comma symbol. 設(shè)置輸入社交數(shù)據(jù)集的路徑。 格式:每行用空、制表符或逗號分隔。ratings.setup-columns 0 1 2-columns: (user, item, rating) columns of rating data are used (用戶、項(xiàng)目、評級)使用評級數(shù)據(jù)列; -header: to skip the first head line when reading data 讀取數(shù)據(jù)時(shí)跳過第一個(gè)頭行social.setup-columns 0 1 2-columns: (trustor, trustee, weight) columns of social data are used (委托方、受托方、權(quán)重)社交數(shù)據(jù)列; -header: to skip the first head line when reading data讀取數(shù)據(jù)時(shí)跳過第一個(gè)頭行recommenderUserKNN/ItemKNN/SlopeOne/etc.Set the recommender to use. 設(shè)置推薦使用evaluation.setup-testSet ../dataset/testset.txtMain option(主要選項(xiàng)): -testSet, -ap, -cv -testSet path/to/test/file (need to specify the test set manually 需要手動指定測試集) -ap ratio ap比率(ap means that the ratings are automatically partitioned into training set and test set, the number is the ratio of test set. e.g. -ap 0.2 ap表示評級自動分為訓(xùn)練集和測試集,數(shù)字是測試集的比例。例如-ap 0.2) -cv k (-cv means cross validation, k is the number of the fold. e.g. -cv 5 -cv表示交叉驗(yàn)證,k是折疊的編號。例如-cv 5) Secondary option(次要選項(xiàng)):-b, -p, -cold -b val (binarizing the rating values. Ratings equal or greater than val will be changed into 1, and ratings lower than val will be changed into 0. e.g. -b 3.0 對評級值進(jìn)行二值化。 等于或大于val的等級將變?yōu)?,低于val的等級將變?yōu)?。例如:-b 3.0) -p (if this option is added, the cross validation wll be executed parallelly, otherwise executed one by one 如果添加此選項(xiàng),則交叉驗(yàn)證將并行執(zhí)行,否則將逐個(gè)執(zhí)行) -tf (model training would be conducted on TensorFlow if TensorFlow has been installed 如果已安裝TensorFlow,將在TensorFlow上進(jìn)行模型訓(xùn)練) -cold threshold 冷閾值 (evaluation on cold-start users, users in training set with ratings more than threshold will be removed from the test set 對冷啟動用戶的評估,評級超過閾值的訓(xùn)練集中的用戶將從測試集中刪除)item.rankingoff -topN -1Main option: whether to do item ranking 主要選項(xiàng):是否進(jìn)行項(xiàng)目排名 -topN N1,N2,N3...: the length of the recommendation list. 推薦列表的長度。 *RecQ can generate multiple evaluation results for different N at the same time.* RecQ可以同時(shí)為不同的N生成多個(gè)評估結(jié)果output.setupon -dir ./Results/Main option: whether to output recommendation results 主要選項(xiàng):是否輸出推薦結(jié)果 -dir path: the directory path of output results. 輸出結(jié)果的目錄路徑。
-設(shè)置要使用的相似性方法。 選項(xiàng):PCC,COS;num.shrinkage25Set the shrinkage parameter to devalue similarity value. -1: to disable simialrity shrinkage. -將收縮參數(shù)設(shè)置為貶值相似度值。 -1:禁用simialrity縮小。num.neighbors30Set the number of neighbors used for KNN-based algorithms such as UserKNN, ItemKNN. -設(shè)置用于基于KNN算法的鄰居數(shù),例如UserKNN,ItemKNN。num.factors5/10/20/numberSet the number of latent factors -設(shè)置潛在因素的數(shù)量num.max.iter100/200/numberSet the maximum number of iterations for iterative recommendation algorithms. -設(shè)置迭代推薦算法的最大迭代次數(shù)。learnRate-init 0.01 -max 1-init initial learning rate for iterative recommendation algorithms 初始化迭代推薦算法的初始學(xué)習(xí)率; -max: maximum learning rate (default 1); 最大學(xué)習(xí)率(默認(rèn)為1);reg.lambda-u 0.05 -i 0.05 -b 0.1 -s 0.1-u: user regularizaiton 用戶正則化; -i: item regularization 項(xiàng)目正則化; -b: bias regularizaiton 偏倚正則化; -s: social regularization 社交正則化如何擴(kuò)展 1.讓你的新算法泛化適當(dāng)?shù)幕悺?/p> 2.根據(jù)需要重寫以下一些函數(shù)。
項(xiàng)目地址:https://github.com/Coder-Yu/RecQ 相關(guān)數(shù)據(jù)集參考 [1]. Tang, J., Gao, H., Liu, H.: mtrust:discerning multi-faceted trust in a connected world. In: International Conference on Web Search and Web Data Mining, WSDM 2012, Seattle, Wa, Usa, February. pp. 93–102 (2012) [2]. Massa, P., Avesani, P.: Trust-aware recommender systems. In: Proceedings of the 2007 ACM conference on Recommender systems. pp. 17–24. ACM (2007) [3]. G. Zhao, X. Qian, and X. Xie, “User-service rating prediction by exploring social users’ rating behaviors,” IEEE Transactions on Multimedia, vol. 18, no. 3, pp. 496–506, 2016. [4] Iván Cantador, Peter Brusilovsky, and Tsvi Kuflik. 2011. 2nd Workshop on Information Heterogeneity and Fusion in Recom- mender Systems (HetRec 2011). In Proceedings of the 5th ACM conference on Recommender systems (RecSys 2011). ACM, New York, NY, USA |
|