private static void repeat(double[][] inputs, int[] outputs,
DecisionTree tree, int training, double threshold,
out int nodeCount2)
{
int nodeCount = 0;
foreach (var node in tree)
nodeCount++;
var pruningInputs = inputs.Submatrix(training, inputs.Length - 1);
var pruningOutputs = outputs.Submatrix(training, inputs.Length - 1);
ErrorBasedPruning prune = new ErrorBasedPruning(tree, pruningInputs, pruningOutputs);
prune.Threshold = threshold;
double lastError;
double error = Double.PositiveInfinity;
do
{
lastError = error;
error = prune.Run();
} while (error < lastError);
nodeCount2 = 0;
foreach (var node in tree)
nodeCount2++;
}
}