Limiting false positives
See original GitHub issueDuring excessive testing, I found that I get about 5 to 10 percent false positives. But I found out – and I do not think that this is documented - if you check the error of the decodedCodes
, you will find that by rejection codes with a certain error margin will increase your hit rate 100 percent.
This is the code I use. I take the average error margin. If it is below 0.1 it is fair to assume we detected the code correct.
So far I had no false positives at all while still a very fast detection.
var countDecodedCodes=0, err=0;
$.each(result.codeResult.decodedCodes, function(id,error){
if (error.error!=undefined) {
countDecodedCodes++;
err+=parseFloat(error.error);
}
});
if (err/countDecodedCodes < 0.1) {
// correct code detected
} else {
// probably wrong code
}
Hope this helps!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:15
Top Results From Across the Web
How to Avoid False Positives and False Negatives ... - ACD/Labs
The most effective way to reduce both your false positives and negatives is using a high-quality method. This is particularly important in ...
Read more >Limit of Detection; Type I (False Positive) and ... - ConsultGLP
So, when we state “Not Detected (ND) ” for an analyte in our test report, it indicates that this analyte may be present...
Read more >Practices of Science: False Positives and False Negatives
A false positive is when a scientist determines something is true when it is actually false (also called a type I error).
Read more >Handling false negatives, false positives and reporting limits in ...
This paper concludes that the z-scoring system is adaptable without change to false negatives and positives, although a degree of statistical expertise is ......
Read more >How to limit false positives in environmental DNA and ...
Unfortunately, false positives may occur for multiple reasons, such as contamination during sampling or during laboratory work, PCR or ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Based on @iFlash answer, I made it using median instead of averages.
During my tests (built-in webcam), I noticed that many times it reads correctly, but its averages were all above 0.1 because some of the errors has a much higher value like
0.3 ..0.4
while others are0.05. .0.07
, thus “pulling” the average up.Medians represents most of the dataset a bit better. That being said, I still get false positives occasionally. Hit rate of probably 7-8/10, but a faster match than averages.
Its good for me.