This repository was archived by the owner on Nov 19, 2020. It is now read-only.

Description
In v2.15, when you have 2 inputs that are exactly the same but for some reason have different outputs, you get an unhandled exception:
double[][] inputs = new double[][] {
new double[] { 0 },
new double[] { 0 }
};
int[] outputs = new int[] {
1,
0
};
DecisionVariable[] variables = { new DecisionVariable("x", DecisionVariableKind.Continuous) };
DecisionTree decisionTree = new DecisionTree(variables, 2);
C45Learning c45Learning = new C45Learning(decisionTree);
c45Learning.Run(inputs, outputs); // System.AggregateException thrown here
A first chance exception of type 'System.AggregateException' occurred in mscorlib.dll
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body)
at Accord.MachineLearning.DecisionTrees.Learning.C45Learning.split(DecisionNode root, Double[][] input, Int32[] output, Int32 height)
at Accord.MachineLearning.DecisionTrees.Learning.C45Learning.Run(Double[][] inputs, Int32[] outputs)
It also happens with more than 2 inputs (for example, you can make the DecisionTree sample app crash by changing examples.xls).
ID3 algorithm isn't affected.
Thanks,
Liad