diff --git a/src/LarvaDatasets.jl b/src/LarvaDatasets.jl index f1dcbdeeb1787fba4118fc77c16a97b387840e45..328675fa321eb82f51ae73e3a217f58f7ad4895d 100644 --- a/src/LarvaDatasets.jl +++ b/src/LarvaDatasets.jl @@ -251,12 +251,12 @@ function balancedcounts(counts, targetcount=nothing, majorityweight=2) end """ - thresholdedcounts(observed_counts, majorityweight=10) + thresholdedcounts(observed_counts, majorityweight=20) Derive sample sizes for all labels, with an upper bound set as `majorityweight` times the cardinal of the least represented class. """ -function thresholdedcounts(counts; majorityweight=10) +function thresholdedcounts(counts; majorityweight=20) counts = typeof(counts)(k=>count for (k, count) in pairs(counts) if 0 < count) majoritythresh = minimum(values(counts)) * majorityweight thresholdedcounts = Dict(k=>(count < majoritythresh ? count : majoritythresh) for (k, count) in pairs(counts))