parameters: (self)
docstring: Draw trees in png files
docstring_summary: Draw trees in png files
docstring_tokens: Draw trees in png files
function: def draw_trees(self):
          """ Draw trees in png files """
  
          from sklearn.tree import export_graphviz
          import subprocess
  
          images = []
          for i, tree in enumerate(self.clf.estimators_):
              # creates indel_tree_...dot files
              fname = 'trees/tree_' + str(i) + '.dot'
              with open(fname, 'w') as dotfile:
                  export_graphviz(
                      tree,
                      dotfile,
                      feature_names=featurenames)
              # run dot
              subprocess.check_call(["dot -Tpng " + fname + " > " + fname + ".png"], shell=True)
              images.append(Image(fname + ".png"))
function_tokens: def draw_trees ( self ) : from sklearn . tree import export_graphviz import subprocess images = [ ] for i , tree in enumerate ( self . clf . estimators_ ) : # creates indel_tree_...dot files fname = 'trees/tree_' + str ( i ) + '.dot' with open ( fname , 'w' ) as dotfile : export_graphviz ( tree , dotfile , feature_names = featurenames ) # run dot subprocess . check_call ( [ "dot -Tpng " + fname + " > " + fname + ".png" ] , shell = True ) images . append ( Image ( fname + ".png" ) )