change user deletion scope from 120 days to 60 days
This commit is contained in:
@@ -38,14 +38,14 @@ module Reports
|
||||
end
|
||||
|
||||
def self.deletion_confidence_interval_for(user, days = nil)
|
||||
date = (days || 120).days.ago
|
||||
date = (days || 60).days.ago
|
||||
deletions = Post.where("created_at >= ?", date).where(:uploader_id => user.id, :is_deleted => true).count
|
||||
total = Post.where("created_at >= ?", date).where(:uploader_id => user.id).count
|
||||
ci_lower_bound(deletions, total)
|
||||
end
|
||||
|
||||
def self.negative_score_confidence_interval_for(user, days = nil)
|
||||
date = (days || 120).days.ago
|
||||
date = (days || 60).days.ago
|
||||
hits = Post.where("created_at >= ? and score < 0", date).where(:uploader_id => user.id).count
|
||||
total = Post.where("created_at >= ?", date).where(:uploader_id => user.id).count
|
||||
ci_lower_bound(hits, total)
|
||||
|
||||
@@ -523,7 +523,7 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def max_upload_limit
|
||||
dcon = [deletion_confidence(120), 15].min
|
||||
dcon = [deletion_confidence(60), 15].min
|
||||
[(base_upload_limit * (1 - (dcon / 15.0))).ceil, 10].max
|
||||
end
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ class UserPresenter
|
||||
return "none"
|
||||
end
|
||||
|
||||
dcon = [user.deletion_confidence(120), 15].min
|
||||
dcon = [user.deletion_confidence(60), 15].min
|
||||
multiplier = (1 - (dcon / 15.0))
|
||||
max_count = [(user.base_upload_limit * multiplier).ceil, 5].max
|
||||
uploaded_count = Post.for_user(user.id).where("created_at >= ?", 24.hours.ago).count
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div id="a-user-promotions">
|
||||
<h1>User Promotion Report</h1>
|
||||
|
||||
<p>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 120 days. Most statistics are not significant unless there are at least 300 uploads.</p>
|
||||
<p>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 60 days. Most statistics are not significant unless there are at least 300 uploads.</p>
|
||||
|
||||
<table width="100%" class="striped" id="sortable">
|
||||
<thead>
|
||||
|
||||
Reference in New Issue
Block a user