Skip to content

Commit

Permalink
changes on the hot-score calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
kikito committed Sep 8, 2015
1 parent 3652de4 commit eac0928
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/debate.rb
Expand Up @@ -114,7 +114,7 @@ def calculate_hot_score
z = 1.96 # Normal distribution with a confidence of 0.95
time_unit = 1.0 * 12.hours
start = Time.new(2015, 6, 15)
comments_weight = 1.0/3 # 3 comments == 1 positive vote
comments_weight = 1.0/20 # 1 positive vote / x comments

weighted_score = 0

Expand All @@ -127,7 +127,7 @@ def calculate_hot_score

age_in_units = 1.0 * ((created_at || Time.now) - start) / time_unit

self.hot_score = (age_in_units**3 + weighted_score * 1000).round
self.hot_score = ((age_in_units**2 + weighted_score)*1000).round
end

def self.search(terms)
Expand Down

0 comments on commit eac0928

Please sign in to comment.