2

I'm trying to work out the best way to weight my products and which order they should appear in on home page etc.

There are four metrics I want to crunch and turn into a ranking:

  • Purchases for the product
  • How old the product is (in days)
  • How many times the product has been saved
  • How many times the product has been viewed

Ideally, each of these will have an adjustable weighting:

Purchases: 40% Age: 10% Saves: 30% Views: 20%

I've had a read of http://blog.linkibol.com/2010/05/07/how-to-build-a-popularity-algorithm-you-can-be-proud-of/

Bayesian also seems like a good method as it smooths the averages out using constants.

Basically I'm looking for a library/plugin etc. that I can use in my CakePHP project to achieve this.

Any suggestions? Stack is CakePHP/Apache/MySQL

4

1 回答 1

0

根据您的描述,这似乎可行:

SELECT ifnull(purchases,0) * .4 + ifnull(product_age,0) * .1 + ifnull(save_count,0) * .3 + ifnull(view_count,0) * .2 as weighting
FROM my_table

或发布一组更新的要求...

于 2012-10-06T15:37:11.517 回答