Open Zero3 opened 9 years ago
Do you have an example input for this?
I can reproduce it by changing these two lines in the example:
int maxDepth = 10;
int minLeafSize = 10;
to:
int maxDepth = 5;
int minLeafSize = 5;
I use the input data I posted at https://gist.github.com/Zero3/55963dcf14c87e439668 which can be deserialized from a file using something like this:
try (ObjectInput input = new ObjectInputStream(new BufferedInputStream(new FileInputStream("algorithmfoundry-Foundry-issues-45.ser"))))
{
Collection<InputOutputPair<Vector, String>> trainData = (Collection<InputOutputPair<Vector, String>>) input.readObject();
}
catch (IOException | ClassNotFoundException ex)
{
throw new RuntimeException(ex);
}
(Note that my OutputType
is String
while the example uses Boolean
)
(Please note that the test case above uses the same wrong parameter names as used in the example in #6)
I did some further testing with your new RandomForestFactory
. I can consistently trigger the sanity check with minLeafSize = {2, 3, 4} when maxTreeDepth > 1.
Yes, I still need to look into this. Have you seen it happen when minLeafSize = 0?
java.lang.IllegalArgumentException: minSplitSize must be positive (was 0).
at gov.sandia.cognition.util.ArgumentChecker.assertIsPositive(ArgumentChecker.java:61)
at gov.sandia.cognition.learning.algorithm.tree.AbstractVectorThresholdMaximumGainLearner.setMinSplitSize(AbstractVectorThresholdMaximumGainLearner.java:457)
at gov.sandia.cognition.learning.algorithm.tree.AbstractVectorThresholdMaximumGainLearner.<init>(AbstractVectorThresholdMaximumGainLearner.java:86)
at gov.sandia.cognition.learning.algorithm.tree.VectorThresholdInformationGainLearner.<init>(VectorThresholdInformationGainLearner.java:78)
[...]
I was playing around with the parameters for the Random Forest example from #6 and somehow triggered a sanity check in
AbstractVectorThresholdMaximumGainLearner
that probably should not be triggerable: