User group Category
00 cleanliness
01 cleanliness, location 02 cleanliness, location, room
03 cleanliness, location, room, service 04 cleanliness, location, room, service, value 05 cleanliness, location, room, value
06 cleanliness, location, service 07 cleanliness, location, service, value 08 cleanliness, location, value
09 cleanliness, room
10 cleanliness, room, service 11 cleanliness, room, service, value 12 cleanliness, room, value
13 cleanliness, service 14 cleanliness, service, value 15 cleanliness, value
16 location
17 location, room
18 location, room, service 19 location, room, service, value 20 location, room, value
21 location, service 22 location, service, value 23 location, value
24 room
25 room, service
26 room, service, value
27 room, value
28 service
29 service, value
30 value
表 4.1: 各用戶類別對於飯店的喜好取向
•
libFM Regression 實驗: 觀察原始資料集評分,雖評分範圍是由 0 至 5 分,但卻是一個左偏(Negative skew)的分布,大多數的評 分落在 3.5 分至 5 分之間,可參考圖 3.2 ,因此我們將訓練組的表 4.2: 用戶對飯店評分的等第化處理(libFM Regression 實驗)
‧
•
libFM Binary Classification 實驗: 同樣地,由於原始資料集評分是 一個左偏(Negative skew)的分布,可參考圖 3.2,因此我們將訓 練組的評分進行如 表 4.3 的等第化後再進行實驗。原始評分 等第化後評分
小於 4.5 分 0( 不相關)
大於等於 4.5 分 1(相 關)
表 4.3: 用戶對飯店評分的等第化處理(libFM Binary Classification 實驗)
4.2.1 實 實 實驗 驗 驗程 程 程序 序 序( ( ( Experimental Procedure) ) )
User-based CF:為了要讓推薦效能有所比較,我們也將學習組的資 料送入一個以使用者為基礎的協同過濾引擎執行預測,我們實作的 User-based CF 是以皮爾森相關係數(Pearson correlation coefficient)找 出相關最近鄰,其中最近鄰數量(Neighborhood size)設定為 5 。 libFM 參參參數數數:我們採用 MCMC 的方式讓 libFM 學習推薦模型參數,
參考 libFM 的使用手冊,使用 MCMC時無須指定額外的預設參數
(hyperparameters);在這次研究中使用的 libFM 的指令如下:
./libFM -method mcmc -iter 200 -task r -train training.dat.libfm -test test-ing.dat.libfm -dim ’1,1,8’ –relation rel.user,rel.item -out city.out.dat
實
1. Boolean:詞組(Term)是否出現
2. TF:即 Term Frequency ,詞組的出現次數
3. TF-IDF: Term Frequency - Inverse Document Frequency
‧
實驗結果分為兩部分呈現,一為 libFM Regression 的結果;另一則為 libFM Binary Classification 的結果。 我們的虛無假設是「加入了使用 者文字評論後,推薦系統的推薦效能與加入了使用者文字評論之前相 是 libfm 未加入使用者文字評論之 MAP@
k
, libfm1、libfm2、libfm5 以及 libfm6 等列則分別是 libfm 加入使用者文字評論,並且以不 同的權重方式設定飯店的特徵值實驗之 MAP@k
, 我們依序列出 了 MAP@3
、MAP@5
、MAP@7
以及 MAP@10
之實驗結果。 Paired Sample T-Test 的 P-value用以檢定 libfm0 與 libfm1、libfm2、libfm5 以 及 libfm6 等列是否來自於同一母體。‧
map@3 beijing chicago dubai las-vegas london montreal new-delhi new-york-city san-francisco shanghai average p-value
cf 0.515741 0.523148 0.547222 0.646296 0.408333 0.744444 0.759259 0.566667 0.566667 0.676852 0.5954629
libfm0 0.621296 0.715741 0.628704 0.811111 0.676852 0.784259 0.810185 0.724074 0.727778 0.794444 0.7294444
libfm1(boolean) 0.630556 0.724074 0.663889 0.798148 0.691667 0.793519 0.802778 0.721296 0.718519 0.785185 0.7329631 0.4719338 libfm2(tf) 0.655556 0.738889 0.597222 0.847222 0.643519 0.785185 0.819444 0.72963 0.710185 0.791667 0.7318519 0.7649599 libfm5(tfidf) 0.660185 0.732407 0.608333 0.825926 0.637037 0.751852 0.838889 0.722222 0.710185 0.794444 0.728148 0.8791349 libfm6(log avg) 0.662963 0.753704 0.599074 0.816667 0.590741 0.8 0.837963 0.740741 0.709259 0.816667 0.7327779 0.7918063 map@5 beijing chicago dubai las-vegas london montreal new-delhi new-york-city san-francisco shanghai average p-value
cf 0.477167 0.726667 0.561389 0.769333 0.536389 0.638333 0.7375 0.620833 0.563889 0.664722 0.6296222
libfm0 0.740333 0.771778 0.745389 0.8175 0.768833 0.836389 0.839278 0.790722 0.812389 0.794444 0.7917055
libfm1(boolean) 0.743833 0.772722 0.751722 0.823167 0.773 0.833167 0.845778 0.775389 0.799222 0.798833 0.7916833 0.9932313 libfm2(tf) 0.740889 0.781333 0.729 0.794611 0.735222 0.811278 0.856611 0.785222 0.808444 0.797444 0.7840054 0.1706583 libfm5(tfidf) 0.755111 0.757889 0.726111 0.804056 0.724611 0.823111 0.846389 0.788333 0.806667 0.799222 0.78315 0.1372586 libfm6(log avg) 0.769833 0.799611 0.702333 0.826944 0.704889 0.835 0.852611 0.760167 0.806222 0.810278 0.7867888 0.6316580 map@7 beijing chicago dubai las-vegas london montreal new-delhi new-york-city san-francisco shanghai average p-value
cf 0.532642 0.737834 0.594382 0.736944 0.538639 0.671128 0.771644 0.72589 0.603611 0.642302 0.6555016
libfm0 0.768492 0.74271 0.814654 0.821264 0.784688 0.818719 0.867477 0.788639 0.821797 0.822585 0.8051025
libfm1(boolean) 0.780272 0.728991 0.816145 0.831372 0.782205 0.819694 0.866967 0.786616 0.827188 0.82818 0.806763 0.4884474 libfm2(tf) 0.782285 0.747925 0.811553 0.813878 0.774461 0.830476 0.867908 0.792222 0.831888 0.836967 0.8089563 0.1996476 libfm5(tfidf) 0.78377 0.732613 0.792455 0.818197 0.756372 0.812613 0.867789 0.794909 0.818214 0.823685 0.8000617 0.2446659 libfm6(log avg) 0.804563 0.749603 0.794745 0.818186 0.754734 0.832545 0.876576 0.779416 0.831349 0.838413 0.808013 0.6406164 map@10 beijing chicago dubai las-vegas london montreal new-delhi new-york-city san-francisco shanghai average p-value
cf 0.544618 0.761342 0.670422 0.769819 0.608777 0.770094 0.792899 0.690841 0.668005 0.672663 0.694948
libfm0 0.872464 0.788432 0.863015 0.840524 0.815417 0.861119 0.919158 0.79729 0.819553 0.882557 0.8459529
libfm1(boolean) 0.869301 0.798564 0.867649 0.851691 0.812809 0.863676 0.915991 0.800351 0.809958 0.88167 0.847166 0.5642440 libfm2(tf) 0.863831 0.796439 0.850513 0.836548 0.808331 0.863125 0.924431 0.803593 0.823674 0.889182 0.8459667 0.9954251 libfm5(tfidf) 0.872 0.787538 0.839977 0.847617 0.791592 0.855313 0.919454 0.79356 0.813886 0.886467 0.8407404 0.1473813 libfm6(log avg) 0.876243 0.796161 0.845206 0.851931 0.795537 0.868207 0.923467 0.795775 0.822556 0.895251 0.8470334 0.7689346
表 4.4: 實驗結果:以 libFM Regression 所實驗的 MAP@k
在此 libFM Regression 的實驗結果中,可觀察到在尚未加入使用 者文字評論時, libFM 的推薦效能比 User-based CF 來得好;而在
map@3 beijing chicago dubai las-vegas london montreal new-delhi new-york-city san-francisco shanghai average p-value
cf 0.294444 0.237037 0.442593 0.296481 0.343519 0.101852 0.764444 0.557407 0.564815 0.635741 0.4238333
libfm0 0.568519 0.621296 0.611111 0.65 0.528704 0.505556 0.761111 0.514815 0.601852 0.655556 0.601852
libfm1(boolean) 0.575926 0.625926 0.580556 0.662963 0.513889 0.560185 0.782407 0.536111 0.640741 0.675926 0.615463 0.1117078 libfm2(tf) 0.580556 0.691667 0.618519 0.698148 0.497222 0.512963 0.791667 0.589815 0.678704 0.712037 0.6371298 0.0129157 libfm5(tfidf) 0.57963 0.673148 0.612963 0.677778 0.555556 0.515741 0.781481 0.547222 0.67037 0.69537 0.6309259 0.0014221 libfm6(log avg) 0.661111 0.700926 0.628704 0.728704 0.47037 0.557407 0.807407 0.528704 0.721296 0.722222 0.6526851 0.0108384 map@5 beijing chicago dubai las-vegas london montreal new-delhi new-york-city san-francisco shanghai average p-value
cf 0.441944 0.606444 0.515444 0.676222 0.476722 0.3495 0.797967 0.481056 0.532556 0.719989 0.5597844
libfm0 0.610556 0.767167 0.698667 0.750278 0.620667 0.711778 0.762667 0.628333 0.766167 0.659833 0.6976113
libfm1(boolean) 0.641111 0.777167 0.691 0.744667 0.614667 0.728222 0.769056 0.631889 0.794389 0.685278 0.7077446 0.0548950 libfm2(tf) 0.631556 0.807667 0.705056 0.759 0.636111 0.741056 0.782944 0.663333 0.811889 0.678167 0.7216779 0.0002687 libfm5(tfidf) 0.651 0.786889 0.666167 0.757444 0.632333 0.734278 0.779222 0.629389 0.814944 0.702278 0.7153944 0.0419262 libfm6(log avg) 0.681889 0.828944 0.699556 0.778167 0.601278 0.767611 0.785056 0.6295 0.822444 0.738389 0.7332834 0.0087191 map@7 beijing chicago dubai las-vegas london montreal new-delhi new-york-city san-francisco shanghai average p-value
cf 0.504195 0.681502 0.614461 0.714167 0.511791 0.534388 0.81983 0.503237 0.596253 0.711684 0.6191508
libfm0 0.680374 0.799722 0.752585 0.771661 0.638906 0.766752 0.735913 0.670737 0.78835 0.695964 0.7300964
libfm1(boolean) 0.702823 0.817313 0.753169 0.766888 0.637931 0.793923 0.729841 0.665969 0.809014 0.717375 0.7394246 0.0573433 libfm2(tf) 0.697205 0.827387 0.754909 0.790306 0.651213 0.807256 0.743299 0.68602 0.839507 0.722562 0.7519664 0.0012678 libfm5(tfidf) 0.705884 0.812103 0.743566 0.790068 0.655108 0.806599 0.733617 0.673396 0.824036 0.721684 0.7466061 0.0097045 libfm6(log avg) 0.731298 0.845181 0.780805 0.793827 0.637812 0.841871 0.746372 0.678203 0.840652 0.750085 0.7646106 0.00169194 map@10 beijing chicago dubai las-vegas london montreal new-delhi new-york-city san-francisco shanghai average p-value
cf 0.554913 0.785586 0.666964 0.774523 0.591454 0.722577 0.789362 0.576205 0.712776 0.699294 0.6873654
libfm0 0.767386 0.841497 0.801757 0.763442 0.680243 0.837069 0.621765 0.749686 0.828511 0.718608 0.7609964
libfm1(boolean) 0.780466 0.845296 0.806629 0.776937 0.684448 0.860649 0.619065 0.760331 0.851335 0.731304 0.771646 0.0030475 libfm2(tf) 0.776671 0.869046 0.812294 0.780397 0.695108 0.871958 0.649272 0.777022 0.853596 0.737297 0.7822661 0.0000227 libfm5(tfidf) 0.776015 0.864944 0.805093 0.776968 0.693509 0.862655 0.627728 0.774835 0.855354 0.734574 0.7771675 0.0002306 libfm6(log avg) 0.801063 0.865625 0.812727 0.795646 0.695501 0.884198 0.641737 0.781414 0.866849 0.761498 0.7906258 0.0000242
表 4.5: 實驗結果:以 libFM Binary Classification 所實驗的 MAP@k
‧
是 libfm 未加入使用者文字評論之 MAP@k
, libfm1、libfm2、libfm5 以及 libfm6 等列則分別是 libfm 加入使用者文字評論,並且以不 同的權重方式設定飯店的特徵值實驗之 MAP@k
, 我們依序列出 了 MAP@3
、MAP@5
、MAP@7
以及 MAP@10
之實驗結果。 Paired Sample T-Test 的 P-value用以檢定 libfm0 與 libfm1、libfm2、libfm5 以 及 libfm6 等列是否來自於同一母體。在此 libFM Binary Classification 的實驗結果中,亦可觀察到 libFM 較 User-based CF 的推薦效能來得好;且在加入了使用者文字評論後, Binary Classification 的實驗中,加入了使用者文字評論為特徵值之後 的推薦效能是有所增加的。
4.4 討 討 討論 論 論 與 與 與分 分 分析 析 析( ( ( Discusssion and Analysis) ) )
libFM Binary Classification實實實驗驗驗: 圖 4.1 呈現了 User-based CF(cf)、
尚未加入文字評論的 libFM(libfm0)以及加入了文字評論的 libFM(libfm6)
的比較。可看出三種方法的效能有顯著的不同,以加入了文字評論 的 libFM (libfm6)方法的推薦效能最佳,與尚未加入文字評論的 libFM(libfm0)方法比較, MAP@
k
大約有 2.5% 至 5% 的改善。libFM Regression 實實實驗驗驗:在 libFM Regression 這部分的實驗,雖然 libFM 的效能表現優於 User-based CF 的做法,但是加入了文字評論的
‧ 國
立 政 治 大 學
‧
N a tio na
l C h engchi U ni ve rs it y
圖 4.1: 各種不同方法的 MAP@k
夠有效的提升二元分類的預測效能;以飯店推薦的角度來看,二元 分類的結果其實就是用戶「有興趣去住」與「沒有興趣去住」的預 測分類,倘能充分運用這樣的技術來改善推薦系統之效能,不論是 商家或是用戶,雙方彼此都能有所獲益。此外, libFM 本身是一個 模型式(Model-based)的預測器,相較於協同過濾,其屬於記憶式
(Memore-based)的推薦方式,模型式系統更適合於線上系統的應 用,且能產出很好的推薦項目,這個實驗結果印證了我們的想法。