tabular/src/autogluon/tabular/task/tabular_prediction/predictor.py
def plot_ensemble_model(self, prune_unused_nodes=True):
        """
            Output the visualized stack ensemble architecture of a model trained by `fit()`. 
            The plot is stored to a file, `ensemble_model.png` in folder `Predictor.output_directory` 

            This function requires `graphviz` and `pygraphviz` to be installed because this visualization depends on those package.
            Unless this function will raise `ImportError` without being able to generate the visual of the ensemble model.

            To install the required package, run the below commands (for Ubuntu linux):

            $ sudo apt-get install graphviz
            $ pip install graphviz

            For other platforms, refer to https://graphviz.org/ for Graphviz install, and https://pygraphviz.github.io/documentation.html for PyGraphviz.


        Parameters
        ----------

        Returns
        -------
        The file name with the full path to the saved graphic
        """
        try:
            import pygraphviz
        except:
            raise ImportError('Visualizing ensemble network architecture requires pygraphviz library')
            
        G = self._trainer.model_graph.copy()

        if prune_unused_nodes == True:
            nodes_without_outedge = [node for node,degree in dict(G.degree()).items() if degree < 1]
        else:
            nodes_without_outedge = []

        nodes_no_val_score = [node for node in G if G.nodes[node]['val_score'] == None]
        
        G.remove_nodes_from(nodes_without_outedge)
        G.remove_nodes_from(nodes_no_val_score)

        root_node = [n for n,d in G.out_degree() if d == 0]
        best_model_node = self.get_model_best()

        A = nx.nx_agraph.to_agraph(G)
        
        A.graph_attr.update(rankdir='BT')
        A.node_attr.update(fontsize=10)
        A.node_attr.update(shape='rectangle')

        for node in A.iternodes():
            node.attr['label'] = f"{node.name}\nVal score: {float(node.attr['val_score']):.4f}"

            if node.name == best_model_node:
                node.attr['style'] = 'filled'
                node.attr['fillcolor'] = '#ff9900'
                node.attr['shape'] = 'box3d'
            elif nx.has_path(G, node.name, best_model_node):
                node.attr['style'] = 'filled'
                node.attr['fillcolor'] = '#ffcc00'

        model_image_fname = os.path.join(self.output_directory, 'ensemble_model.png')

        A.draw(model_image_fname, format='png', prog='dot')

        return model_image_fname

            Output the visualized stack ensemble architecture of a model trained by `fit()`. 
            The plot is stored to a file, `ensemble_model.png` in folder `Predictor.output_directory` 

            This function requires `graphviz` and `pygraphviz` to be installed because this visualization depends on those package.
            Unless this function will raise `ImportError` without being able to generate the visual of the ensemble model.

            To install the required package, run the below commands (for Ubuntu linux):

            $ sudo apt-get install graphviz
            $ pip install graphviz

            For other platforms, refer to https://graphviz.org/ for Graphviz install, and https://pygraphviz.github.io/documentation.html for PyGraphviz.


        Parameters
        ----------

        Returns
        -------
        The file name with the full path to the saved graphic
        
Output the visualized stack ensemble architecture of a model trained by `fit()`.
The plot is stored to a file, `ensemble_model.png` in folder `Predictor.output_directory`

This function requires `graphviz` and `pygraphviz` to be installed because this visualization depends on those package.
Unless this function will raise `ImportError` without being able to generate the visual of the ensemble model.

To install the required package, run the below commands (for Ubuntu linux).

$ sudo apt-get install graphviz
$ pip install graphviz



Parameters

Returns

The file name with the full path to the saved graphic
Output the visualized stack ensemble architecture of a model trained by ` fit () ` . The plot is stored to a file ` ensemble_model . png ` in folder ` Predictor . output_directory ` This function requires ` graphviz ` and ` pygraphviz ` to be installed because this visualization depends on those package . Unless this function will raise ` ImportError ` without being able to generate the visual of the ensemble model . To install the required package run the below commands ( for Ubuntu linux ) . $ sudo apt - get install graphviz $ pip install graphviz Parameters Returns The file name with the full path to the saved graphic
def plot_ensemble_model(self, prune_unused_nodes=True):
        try:
            import pygraphviz
        except:
            raise ImportError('Visualizing ensemble network architecture requires pygraphviz library')
        G = self._trainer.model_graph.copy()
        if prune_unused_nodes == True:
            nodes_without_outedge = [node for node,degree in dict(G.degree()).items() if degree < 1]
        else:
            nodes_without_outedge = []
        nodes_no_val_score = [node for node in G if G.nodes[node]['val_score'] == None]
        G.remove_nodes_from(nodes_without_outedge)
        G.remove_nodes_from(nodes_no_val_score)
        root_node = [n for n,d in G.out_degree() if d == 0]
        best_model_node = self.get_model_best()
        A = nx.nx_agraph.to_agraph(G)
        A.graph_attr.update(rankdir='BT')
        A.node_attr.update(fontsize=10)
        A.node_attr.update(shape='rectangle')
        for node in A.iternodes():
            node.attr['label'] = f"{node.name}\nVal score: {float(node.attr['val_score']):.4f}"
            if node.name == best_model_node:
                node.attr['style'] = 'filled'
                node.attr['fillcolor'] = '#ff9900'
                node.attr['shape'] = 'box3d'
            elif nx.has_path(G, node.name, best_model_node):
                node.attr['style'] = 'filled'
                node.attr['fillcolor'] = '#ffcc00'
        model_image_fname = os.path.join(self.output_directory, 'ensemble_model.png')
        A.draw(model_image_fname, format='png', prog='dot')
        return model_image_fname
def plot_ensemble_model ( self , prune_unused_nodes = True ) : try : import pygraphviz except : raise ImportError ( 'Visualizing ensemble network architecture requires pygraphviz library' ) G = self . _trainer . model_graph . copy ( ) if prune_unused_nodes == True : nodes_without_outedge = [ node for node , degree in dict ( G . degree ( ) ) . items ( ) if degree < 1 ] else : nodes_without_outedge = [ ] nodes_no_val_score = [ node for node in G if G . nodes [ node ] [ 'val_score' ] == None ] G . remove_nodes_from ( nodes_without_outedge ) G . remove_nodes_from ( nodes_no_val_score ) root_node = [ n for n , d in G . out_degree ( ) if d == 0 ] best_model_node = self . get_model_best ( ) A = nx . nx_agraph . to_agraph ( G ) A . graph_attr . update ( rankdir = 'BT' ) A . node_attr . update ( fontsize = 10 ) A . node_attr . update ( shape = 'rectangle' ) for node in A . iternodes ( ) : node . attr [ 'label' ] = f"{node.name}\nVal score: {float(node.attr['val_score']):.4f}" if node . name == best_model_node : node . attr [ 'style' ] = 'filled' node . attr [ 'fillcolor' ] = '#ff9900' node . attr [ 'shape' ] = 'box3d' elif nx . has_path ( G , node . name , best_model_node ) : node . attr [ 'style' ] = 'filled' node . attr [ 'fillcolor' ] = '#ffcc00' model_image_fname = os . path . join ( self . output_directory , 'ensemble_model.png' ) A . draw ( model_image_fname , format = 'png' , prog = 'dot' ) return model_image_fname
Output the visualized stack ensemble architecture of a model trained by `fit()`.
Output the visualized stack ensemble architecture of a model trained by ` fit () ` .
"""
            Output the visualized stack ensemble architecture of a model trained by `fit()`. 
            The plot is stored to a file, `ensemble_model.png` in folder `Predictor.output_directory` 

            This function requires `graphviz` and `pygraphviz` to be installed because this visualization depends on those package.
            Unless this function will raise `ImportError` without being able to generate the visual of the ensemble model.

            To install the required package, run the below commands (for Ubuntu linux):

            $ sudo apt-get install graphviz
            $ pip install graphviz

            For other platforms, refer to https://graphviz.org/ for Graphviz install, and https://pygraphviz.github.io/documentation.html for PyGraphviz.


        Parameters
        ----------

        Returns
        -------
        The file name with the full path to the saved graphic
        """
self
prune_unused_nodes