Austin
Austin

Reputation: 3890

A good algorithm for ranking gems

I built a site that let's you freely add Rails-related gems, and tag those gems. The next feature I'd like to add is gem ranking. I've considered some of the common systems, like stars and up-voting, but have decided a simple system won't work well enough.

Here are a couple scenario's I want the ranking algorithm to work well for:

Some info we have available to us for gems are:

This info could be part of the algorithm (along with up-votes or stars or whatever we need to collect from the users).

So my question is, can you think of a good algorithm (not exact of course, just describe it) that could handle these scenarios, or at least be able to offer some good advice, or point me in the right direction.

Upvotes: 1

Views: 743

Answers (2)

Michael Papile
Michael Papile

Reputation: 6856

http://ruby-toolbox.com/categories.html is an excellent site that does something similar. They simply rank on downloads, but it is not always true that the most downloaded one is the best IMO. Activity on github etc should be shown because I am not likely to try something new that is not actively being developed.

I would think that downloads should count for something and perhaps decay on a logarithmic scale. development activity should count too. In addition you can add user reviews and incorporate that too. I think that these metrics can be tweaked with certain weights to see what would rank things most appropriately. Perhaps too you can invite the authors to write what their gem offers that others do not in the same class.

I think to handle the gem that suddenly does not handle a new framework etc is to have a downvote button where users can downvote and give a reason from a canned list you provide. If a gem suddenly starts getting down voted, does not have recent activity and the downloads are decreasing, it would then fall. You can then indicate this with a down arrow indicating it is trending down. The most popular reasons can be listed.

Upvotes: 2

TimFoolery
TimFoolery

Reputation: 1925

Number of downloads isn't, in my mind, a very useful meter. There are probably code snippets out there that haven't worked for years, but are still being tried (i.e. downloaded) by thousands of people each month.

  1. Ask the submitter to identify what version of Rails the code was made in. While it may not solve all of your problems because they can't predict what later version of Rails will break it, it takes two seconds to specify that information, and it could save lots of time down the road. Display this on the download page.
  2. Ask the downloader to rate the code... execution speed, execution reliability, code readability, ease of installation, documentation, etc.

Upvotes: 3

Related Questions