def draw_tree(self, data, settings, figure_id=0, i_t=0):
        self.gen_node_ids_print()
        self.gen_cumulative_split_costs_only(settings, data)
        graph = pydot.Dot(graph_type='digraph')
        dummy, graph = self.get_print_label_draw_tree(self.root, graph)
        ADD_TIME = False
        for node_id in self.non_leaf_nodes:
            parent, graph = self.get_print_label_draw_tree(node_id, graph)
            left, graph = self.get_print_label_draw_tree(node_id.left, graph)
            right, graph = self.get_print_label_draw_tree(node_id.right, graph)
            for child, child_id in izip([left, right], [node_id.left, node_id.right]):
                edge = pydot.Edge(parent, child)
                if ADD_TIME and (not child_id.is_leaf):
                    edge.set_minlen(self.max_split_costs[child_id])
                    edge2 = pydot.Edge(dummy, child)
                    edge2.set_minlen(self.cumulative_split_costs[child_id])
                    edge2.set_style('invis')
                    graph.add_edge(edge2)
                graph.add_edge(edge)
        filename_plot_tag = get_filename_mf(settings)[:-2]
        if settings.save:
            tree_name = filename_plot_tag + '-mtree_minibatch-' + str(figure_id) + '.pdf'
            print 'saving file: %s' % tree_name
            graph.write_pdf(tree_name)
function to draw Mondrian tree using pydot
dataset/ETHPy150Open balajiln/mondrianforest/src/mondrianforest.py/MondrianTree.draw_tree