// Implementation for cached computation of weighted output
        // (used by smoothing)
        public double GetWeightedOutput()
        {
            if (!double.IsNaN(_weightedOutput))
            {
                return(_weightedOutput);
            }
            if (NodeIndex < 0)
            {
                return(Tree.GetOutput(~NodeIndex));
            }

            int lteDocCount = LteNode.GetDocumentCount();
            int gtCount     = GtNode.GetDocumentCount();

            _weightedOutput = (lteDocCount * LteNode.GetWeightedOutput() + gtCount * GtNode.GetWeightedOutput())
                              / (lteDocCount + gtCount);
            return(_weightedOutput);
        }