private ExpressionNode optimize(ExpressionNode node) {
        currentTreesOptimized = 0;
        List<Double> forest = new ArrayList<>();
        boolean optimized = optimize(node, forest);
        if ( ! optimized ) return node;

        GBDTForestNode forestNode = new GBDTForestNode(toArray(forest));
        report.incMetric("Number of forests", 1);
        report.incMetric("GBDT trees optimized to forests", currentTreesOptimized);
        return forestNode;
    }
Optimize the given node (only)

@return the resulting node, which may be the input node if it could not be optimized
searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/evaluation/gbdtoptimization/GBDTForestOptimizer.java