def generateSampleNumberForBins(num_per_coder, n, k):
"""
Generate the number of articles necessary to assign each coder * number
of articles, given the bin size.
Formula is: (n - 1)! / (k - 1)! (n - 1)!
"""
a = factorial(n - 1) / ( factorial( k - 1 ) * factorial(n - k) )
## the number per coder doesn't divide evenly into the number of appearances
## subtract the remainder
remainder = num_per_coder % a
num_per_coder -= remainder
## get number of bins
num_bins = len(list(combinations(range(0,n), k)))
return int(num_bins * num_per_coder / a)
#####
### DUPE HANDLING
#####
评论列表
文章目录