Commit 5429d2f051016aee9a2574284e46f22d96a6552e

Authored by Pius Uzamere
1 parent 0ae8a90f

new score computation using beta posterior

Showing 1 changed file with 6 additions and 5 deletions   Show diff stats
app/models/choice.rb
@@ -63,11 +63,12 @@ class Choice < ActiveRecord::Base @@ -63,11 +63,12 @@ class Choice < ActiveRecord::Base
63 end 63 end
64 64
65 def compute_score 65 def compute_score
66 - if wins_plus_losses == 0  
67 - return 0  
68 - else  
69 - (wins.to_f / wins_plus_losses ) * 100  
70 - end 66 + # if wins_plus_losses == 0
  67 + # return 0
  68 + # else
  69 + # (wins.to_f / wins_plus_losses ) * 100
  70 + # end
  71 + (wins.to_f+1)/(wins+1+losses+1) * 100
71 end 72 end
72 73
73 def compute_score! 74 def compute_score!