Solved by KFrank in post #4 
              
              
                Hello Niki! 

Here are ways to draw two different kinds of random batches. 
Let nTest be the total number of test data items you have. 
I will assume that nTest > 2 * k (because this will matter 
for one of the kinds of random batches). 
First (ba in the example code below) we can construct random 
…