diff --git a/library/src/main/java/ca/joeltherrien/randomforest/utils/RUtils.java b/library/src/main/java/ca/joeltherrien/randomforest/utils/RUtils.java index 295881a..d1f4f6f 100644 --- a/library/src/main/java/ca/joeltherrien/randomforest/utils/RUtils.java +++ b/library/src/main/java/ca/joeltherrien/randomforest/utils/RUtils.java @@ -188,4 +188,14 @@ public final class RUtils { return responses; } + public static List produceSublist(List initialList, int[] indices){ + final List newList = new ArrayList<>(indices.length); + + for(int i : indices){ + newList.add(initialList.get(i)); + } + + return newList; + } + }