Accord.MachineLearning.DecisionTrees.Pruning.ErrorBasedPruning.computeErrorWithoutSubtree C# (CSharp) Method

computeErrorWithoutSubtree() private method

private computeErrorWithoutSubtree ( DecisionNode tree, int mostCommon ) : double
tree DecisionNode
mostCommon int
return double
        private double computeErrorWithoutSubtree(DecisionNode tree, int mostCommon)
        {
            var branches = tree.Branches;
            var output = tree.Output;

            tree.Branches = null;
            tree.Output = mostCommon;

            double error = computeError();

            tree.Branches = branches;
            tree.Output = output;

            return error;
        }