def print_tree(self, settings):
        """
        prints some tree statistics: leaf nodes, non-leaf nodes, information and so on
        """
        self.gen_node_ids_print()
        print 'printing tree:'
        print 'len(leaf_nodes) = %s, len(non_leaf_nodes) = %s' \
                % (len(self.leaf_nodes), len(self.non_leaf_nodes))
        print 'node_info ='
        node_ids = [self.root]
        while node_ids:
            node_id = node_ids.pop(0)
            node_id_print = self.node_ids_print[node_id]
            try:
                feat_id, split = self.node_info[node_id]
                print '%10s, feat = %5d, split = %.2f, node_id = %s' % \
                        (node_id_print, feat_id, split, node_id)
                if settings.optype == 'class':
                    print 'counts = %s' % self.counts[node_id]
                else:
                    print 'n_points = %6d, sum_y = %.2f' % (self.n_points[node_id], self.sum_y[node_id])
                left, right = node_id.left, node_id.right
                node_ids.append(left)
                node_ids.append(right)
            except __HOLE__:
                continue
        print 'leaf info ='
        for node_id in self.leaf_nodes:
            node_id_print = self.node_ids_print[node_id]
            print '%10s, train_ids = %s, node_id = %s' % \
                    (node_id_print, self.train_ids[node_id], node_id)
            if settings.optype == 'class':
                print 'counts = %s' % self.counts[node_id]
            else:
                print 'n_points = %6d, sum_y = %.2f' % (self.n_points[node_id], self.sum_y[node_id])
dataset/ETHPy150Open balajiln/mondrianforest/src/mondrianforest.py/MondrianTree.print_tree