Simple ranking algorithm

后端 未结 3 1237
天命终不由人
天命终不由人 2021-02-08 06:24

I need to create a poll that is to create a ranking list of items in order of how good they are. I intend to show each user two items together and make them choose one which the

3条回答
  •  佛祖请我去吃肉
    2021-02-08 06:52

    My assumptions, based on your comment, proceed as follows.

    1. You have a collection of original images.
    2. You have x copies of a given original image where x >= 1.
    3. For a given picture, users will only see copies of that image and not images from another original picture.

    For clarification, do you intend to set it up so user's see two random distorted images, or will you associate distorted images with specific original images?

    If you intend to associate specific distorted images to specific original images, I think my idea will work.

    1. For each vote on a distorted image associated with an original item, add 1 to the total # of votes for that original.
    2. Add 1 to the # of yes votes on the distorted image chosen.
    3. Add 1 to the # of not votes on the distorted image not chosen.
    4. Add 1 to the the total # of votes on each distorted image.
    5. Normalize the "image rank" with image_rank = (# total_distorted_image_votes / # total votes for original image) * 100
    6. Normalize the "yes" rank with yes_rank = (#total_distorted_image_yes_votes / #total_distorted_image_votes)*100
    7. Sort by either image_rank or yes_rank. Using yes_rank will reward images with large percentages of yes votes whereas using image_rank will reward images that appeared a lot.

    You can expand beyond this to start ranking original image "groups" as well if you have a counter for total overall votes. You just normalize those (image_votes / total_votes) * 100 and sort it. Then you'd get a "ranking" of which images appear(ed) the most.

提交回复
热议问题