From 531215f16dde1fe81fc38d030589e5a321a7e5f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Laurent?= <francois.laurent@posteo.net> Date: Sun, 29 Jan 2023 15:50:27 +0100 Subject: [PATCH] raising the threshold a bit --- src/LarvaDatasets.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LarvaDatasets.jl b/src/LarvaDatasets.jl index f1dcbde..328675f 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)) -- GitLab