Merge branch 'fix_PrivacyThreshold'
This commit is contained in:
@@ -326,10 +326,10 @@ if (file_exists('./scripts/thisrun.txt')) {
|
|||||||
// Update the current slider value (each time you drag the slider handle)
|
// Update the current slider value (each time you drag the slider handle)
|
||||||
slider.oninput = function() {
|
slider.oninput = function() {
|
||||||
output.innerHTML = this.value;
|
output.innerHTML = this.value;
|
||||||
document.getElementById("predictionCount").innerHTML = parseInt((this.value * <?php echo $count; ?>)/100);
|
document.getElementById("predictionCount").innerHTML = parseInt(Math.max(10, (this.value * <?php echo $count; ?>)/100));
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<p>If a Human is predicted anywhere among the top <span id="predictionCount"><?php echo $newconfig['PRIVACY_THRESHOLD'] == 0 ? "threshold % of" : intval(($newconfig['PRIVACY_THRESHOLD'] * $count)/100); ?></span> predictions, the sample will be considered of human origin and no data will be collected. Start with 1% and move up as needed.</p>
|
<p>If a Human is predicted anywhere among the top <span id="predictionCount"><?php echo intval(max(10, ($newconfig['PRIVACY_THRESHOLD'] * $count)/100)); ?></span> predictions, the sample will be considered of human origin and no data will be collected. Start with 1% and move up as needed.</p>
|
||||||
</td></tr></table><br>
|
</td></tr></table><br>
|
||||||
|
|
||||||
<table class="settingstable"><tr><td>
|
<table class="settingstable"><tr><td>
|
||||||
|
|||||||
+3
-5
@@ -223,12 +223,10 @@ def predict(sample, sensitivity):
|
|||||||
# Sort by score
|
# Sort by score
|
||||||
p_sorted = sorted(p_labels.items(), key=operator.itemgetter(1), reverse=True)
|
p_sorted = sorted(p_labels.items(), key=operator.itemgetter(1), reverse=True)
|
||||||
|
|
||||||
log.debug("DATABASE SIZE: %d", len(p_sorted))
|
human_cutoff = max(10, int(len(p_sorted) * priv_thresh / 100.0))
|
||||||
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))
|
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))):
|
for i in range(min(10, len(p_sorted))):
|
||||||
if p_sorted[i][0] == 'Human_Human':
|
if p_sorted[i][0] == 'Human_Human':
|
||||||
|
|||||||
Reference in New Issue
Block a user