From f9460a429d7da07537c23eaaec13b5452366c86e Mon Sep 17 00:00:00 2001 From: frederik Date: Thu, 15 Feb 2024 15:20:03 +0100 Subject: [PATCH 1/2] fix: priv_thresh is a percentage, not a fraction --- scripts/server.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/server.py b/scripts/server.py index 5704fc7..729eb29 100755 --- a/scripts/server.py +++ b/scripts/server.py @@ -223,12 +223,10 @@ def predict(sample, sensitivity): # Sort by score p_sorted = sorted(p_labels.items(), key=operator.itemgetter(1), reverse=True) - log.debug("DATABASE SIZE: %d", len(p_sorted)) - log.debug("HUMAN-CUTOFF AT: %d", int(len(p_sorted)*priv_thresh)/10) -# -# # Remove species that are on blacklist + human_cutoff = max(10, int(len(p_sorted) * priv_thresh / 100.0)) - human_cutoff = max(10, int(len(p_sorted) * priv_thresh)) + log.debug("DATABASE SIZE: %d", len(p_sorted)) + log.debug("HUMAN-CUTOFF AT: %d", human_cutoff) for i in range(min(10, len(p_sorted))): if p_sorted[i][0] == 'Human_Human': From 17ff4152174b6780a1753ba87902d2b67c14192c Mon Sep 17 00:00:00 2001 From: frederik Date: Fri, 16 Feb 2024 09:43:02 +0100 Subject: [PATCH 2/2] correct privacy explanation --- scripts/advanced.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/advanced.php b/scripts/advanced.php index 36bd8b6..e017d73 100644 --- a/scripts/advanced.php +++ b/scripts/advanced.php @@ -326,10 +326,10 @@ if (file_exists('./scripts/thisrun.txt')) { // Update the current slider value (each time you drag the slider handle) slider.oninput = function() { output.innerHTML = this.value; - document.getElementById("predictionCount").innerHTML = parseInt((this.value * )/100); + document.getElementById("predictionCount").innerHTML = parseInt(Math.max(10, (this.value * )/100)); } -

If a Human is predicted anywhere among the top predictions, the sample will be considered of human origin and no data will be collected. Start with 1% and move up as needed.

+

If a Human is predicted anywhere among the top predictions, the sample will be considered of human origin and no data will be collected. Start with 1% and move up as needed.