Giter VIP home page Giter VIP logo

covid_batch_size's Introduction

Covid_batch_size

Plots of optimal batch sizes based on number of positive results

TL;DR: Python code that calculates optimal batch size based on percent positive, and percent positive based on batch results. Results: A batch size of 4 or 5 is optimal for 6-10% positive rate (about what the US has right now). Using batch processing can reduce the number of requied tests by 50-60%.

The basic idea is to calculate how many total tests must be performed. This information can be used to optimize scarce resources.

Note: There is a distinction between a sample and a test. A sample is a collection from an individual. A test is the actual determination of positive or negative for a sample or for a batch (a group of samples). If a batch is tested and the result is negative, that means that all individual samples in the batch are negative. If the batch is positive, there is at least one positive sample in the batch. All samples in the batch must then be tested individually.

This program attempts to figure out the optimal batch size for testing.

The basics go like this:

Any given person being tested has a percent liklihood of testing positive
We take the tests and batch process them. That means that we 
process a whole bunch together.  If the results of the batch test
come back negative, then they are all negative.
If the results come back positive, then at least one member of the 
group is positive.  We then process each sample from the group 
idividually.  The total number of tests is the number of batches + the 
number of individuals we had to retest.

How does this save resources?  
Let's do an example.  
Let's assume there are 100 people who were tested, and 2% of them are 
positive. 

If we test them individually, that is 100 tests.

Instead, let's group them into batches of 20.  That makes 5 batches. On 
average, 3 of those batches will come back negative, and 2 will come back 
positive.  We re-test those individuals in the positive group. 

Total number of tests: 5 batch tests + 40 individual tests = 45


If instead, we grouped them into batches of 10 people, then 8 of the 
groups will come back negative, and 2 of the groups will come back 
positive, requiring us to re-process the group members' tests.

Total number of tests: 10 batch tests + 20 individual tests = 30 tests.

Of course, the optimal batch size changes based on the percent positive.

Note: The results from the file are normalized by the number of tests performed.

covid_batch_size's People

Contributors

pwross1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.