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