From 526a127b9de5f9dcf38864986a5deee44e26e182 Mon Sep 17 00:00:00 2001 From: Joel Therrien Date: Wed, 27 Mar 2019 10:57:01 -0700 Subject: [PATCH] Change Forest to keep trees in a List instead of a Collection --- .../ca/joeltherrien/randomforest/tree/Forest.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/ca/joeltherrien/randomforest/tree/Forest.java b/src/main/java/ca/joeltherrien/randomforest/tree/Forest.java index 276c16c..1740f18 100644 --- a/src/main/java/ca/joeltherrien/randomforest/tree/Forest.java +++ b/src/main/java/ca/joeltherrien/randomforest/tree/Forest.java @@ -20,13 +20,16 @@ import ca.joeltherrien.randomforest.CovariateRow; import ca.joeltherrien.randomforest.covariates.Covariate; import lombok.Builder; -import java.util.*; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; import java.util.stream.Collectors; @Builder public class Forest { // O = output of trees, FO = forest output. In practice O == FO, even in competing risk & survival settings - private final Collection> trees; + private final List> trees; private final ResponseCombiner treeResponseCombiner; private final List covariateList; @@ -63,8 +66,8 @@ public class Forest { // O = output of trees, FO = forest output. In prac } - public Collection> getTrees(){ - return Collections.unmodifiableCollection(trees); + public List> getTrees(){ + return Collections.unmodifiableList(trees); } public Map findSplitsByCovariate(){