1

我们有两个矩阵:

  • U->用户特征,包含用户根据项目的 20 个特征的评分(比如电影是项目,它的特征可能是动作、悲剧......) 6x20。
  • M->项目特征(包含项目的特征评级(如果行动,那么它的评级,如果悲剧......)10x20)。

使用 Mahout 算法 matrixmult 取两者的点积。对于每个项目,它都显示相应的 userId 和 prefValue。我们还需要与它们一起生成 ItemId。输出是这样的:

{1:2.8565926935818617,2:2.8814964873086852,3:2.3773543936434685,4:2.496325304186463,5:2.5705926376370076,6:2.1250241960704033}
{1:4.013041997061508,2:4.8002775481850515,3:3.9784440113314012,4:4.166481182599563,5:3.9695193417407655,6:3.1884041114544}
{1:3.651782747107523,2:4.388020478870542,3:4.779716339815735,4:4.1679196459740515,5:3.4571455995298668,6:3.173926716763791}
{1:1.460713098843009,2:1.755208191548217,3:1.9118865359262938,4:1.6671678583896208,5:1.3828582398119467,6:1.2695706867055168}
{1:0.7303565494215045,2:0.8776040957741085,3:0.9559432679631469,4:0.8335839291948104,5:0.6914291199059734,6:0.6347853433527582}
{1:3.665260265121202,2:4.392557489548237,3:3.9839325032084063,4:4.789440462322372,5:3.5796149241077186,6:2.899968609025724}
{1:1.4661041060484805,2:1.7570229958192944,3:1.5935730012833615,4:1.9157761849289485,5:1.4318459696430867,6:1.1599874436102895}
{1:2.7611810536133348,2:3.061568194855434,3:2.417510062701028,4:2.6187515401236525,5:2.8459602149193564,6:2.302795567224229}
{1:1.8407873690755552,2:2.0410454632369546,3:1.6116733751340164,4:1.745834360082434,5:1.8973068099462367,6:1.5351970448161516}
{1:1.7657295572889784,2:1.902295838215425,3:1.7169047303913343,4:1.6411563771362838,5:1.7813697244603068,6:1.880839700488139}

其中有 6 个用户和 10 个项目。这里,对于每个项目,显示用户 id n 偏好值,但不显示项目 id

4

0 回答 0