Merge pull request #592 from broadinstitute/rp_random_forest_improvements

Balancing training classes between SNP/Indel and TP/FP.
This commit is contained in:
Ryan Poplin 2014-04-07 21:22:45 -04:00
commit 416ccef0c5
1 changed files with 3 additions and 0 deletions

View File

@ -1537,6 +1537,9 @@ public class MathUtils {
* @param N - the number of elements to draw
*/
public static <T> List<T> randomSample(final List<T> list, final int N) {
if (list.isEmpty() ) {
return list;
}
return sliceListByIndices(sampleIndicesWithReplacement(list.size(),N),list);
}