src/main/java/weka/classifiers/trees/RandomForestPMMLConsumer.java
private static RandomTree buildRandomTree(RandomTree root, Instances instances, TreeModel treeModel) {
        Instances treeInstances = new Instances(instances);
        treeInstances.setClassIndex(getClassIndex(instances, treeModel));

        root.m_Info = treeInstances;
        root.m_Tree = buildRandomTreeNode(root, treeModel.getNode());

        return root;
    }
private static RandomTree buildRandomTree(RandomTree root, Instances instances, TreeModel treeModel) {
        Instances treeInstances = new Instances(instances);
        treeInstances.setClassIndex(getClassIndex(instances, treeModel));

        root.m_Info = treeInstances;
        root.m_Tree = buildRandomTreeNode(root, treeModel.getNode());

        return root;
    }
Builds a new {@link weka.classifiers.trees.RandomTree Weka RandomTree} from the given {@link org.dmg.pmml.TreeModel PMML TreeModel}.

@param root      The {@link weka.classifiers.trees.RandomTree Weka RandomTree} which is to be built.
@param instances The {@link weka.core.Instances} with the tree's attributes.
@param treeModel The {@link org.dmg.pmml.TreeModel PMML TreeModel} which is to be converted to a {@link weka.classifiers.trees.RandomTree Weka RandomTree}.
@return The same {@code root} instance.