Commit 5429d2f051016aee9a2574284e46f22d96a6552e
1 parent
0ae8a90f
Exists in
master
and in
1 other branch
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 | 63 | end |
64 | 64 | |
65 | 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 | 72 | end |
72 | 73 | |
73 | 74 | def compute_score! | ... | ... |