From 87eabe3b001bf87a69d6a5e20e23e8c191dd1185 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Tue, 9 Jul 2013 11:17:17 -0700 Subject: [PATCH] tweaked user promotion formula --- app/logical/reports/user_promotions.rb | 4 ++-- app/views/reports/user_promotions.html.erb | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/logical/reports/user_promotions.rb b/app/logical/reports/user_promotions.rb index 8885797f6..cdcc5aa89 100644 --- a/app/logical/reports/user_promotions.rb +++ b/app/logical/reports/user_promotions.rb @@ -16,7 +16,7 @@ module Reports end def self.confidence_interval_for(user, n) - up_votes = Post.where("created_at >= ?", min_time).where(:uploader_id => user.id).where("fav_count >= ?", n).count + up_votes = Post.where("created_at >= ?", min_time).where(:is_deleted => false, :uploader_id => user.id).where("score >= ?", n).count total_votes = Post.where("created_at >= ?", min_time).where(:uploader_id => user.id).count ci_lower_bound(up_votes, total_votes, 0.95) end @@ -36,7 +36,7 @@ module Reports end def users - ::User.where("users.level < ? and users.post_upload_count >= 100", ::User::Levels::CONTRIBUTOR).order("created_at desc").limit(50).map {|x| Reports::UserPromotions::User.new(x)} + ::User.where("users.level < ? and users.post_upload_count >= 150", ::User::Levels::CONTRIBUTOR).order("created_at desc").limit(50).map {|x| Reports::UserPromotions::User.new(x)} end end end diff --git a/app/views/reports/user_promotions.html.erb b/app/views/reports/user_promotions.html.erb index 26ba0d0e1..cbdcc8972 100644 --- a/app/views/reports/user_promotions.html.erb +++ b/app/views/reports/user_promotions.html.erb @@ -2,7 +2,7 @@

User Promotion Confidence Intervals

-

Binomial proportion confidence interval for how likely a user's uploads will achieve a fav count of at at least n with 95% confidence within the past 30 days.

+

Binomial proportion confidence interval for how likely a user's uploads will achieve a score of at at least n with 95% confidence within the past 30 days.

@@ -11,7 +11,6 @@ - @@ -19,15 +18,16 @@ <% cache("user-promotions-report/#{Date.today}") do %> <% @report.users.each do |user| %> - - - - - - - - - + <% if user.confidence_interval_for(5) > 0 %> + + + + + + + + + <% end %> <% end %> <% end %>
Level Uploads Agescore:1+ score:5+ score:10+
<%= link_to user.name, user_path(user.user) %><%= user.level_string %><%= user.post_upload_count %><%= time_ago_in_words user.created_at %><%= number_to_percentage user.confidence_interval_for(1), :precision => 0 %><%= number_to_percentage user.confidence_interval_for(5), :precision => 0 %><%= number_to_percentage user.confidence_interval_for(10), :precision => 0 %>
<%= link_to user.name, user_path(user.user) %><%= user.level_string %><%= user.post_upload_count %><%= time_ago_in_words user.created_at %><%= number_to_percentage user.confidence_interval_for(5), :precision => 0 %><%= number_to_percentage user.confidence_interval_for(10), :precision => 0 %>