title: Graph of scikit-learn ExtraTreeClassifier and RandomForestClassifier
body: <p>I am trying to make some graphs that illustrate the difference between RandomForestClassifier and ExtraTreeClassifier in scikit-learn. I think I might have figured it out but I am unsure.  Here is my code to fit and graph the iris dataset with both:</p>
  
  <pre><code>import numpy as np
  from sklearn.datasets import load_iris
  from sklearn.externals.six import StringIO 
  from sklearn import tree
  import pydot
  
  iris = load_iris()
  
  X = iris.data
  y = iris.target
  
  clf = tree.ExtraTreeClassifier()
  
  clf = clf.fit(iris.data, iris.target)
  
  
  dot_data = StringIO() 
  tree.export_graphviz(clf, out_file=dot_data) 
  graph = pydot.graph_from_dot_data(dot_data.getvalue()) 
  file_name = "et_iris.pdf"
  graph.write_pdf(file_name) 
  
  clf = tree.DecisionTreeClassifier()
  
  clf = clf.fit(iris.data, iris.target)
  
  
  dot_data = StringIO() 
  tree.export_graphviz(clf, out_file=dot_data) 
  graph = pydot.graph_from_dot_data(dot_data.getvalue()) 
  file_name = "rdf_iris.pdf"
  graph.write_pdf(file_name) 
  </code></pre>
  
  <p>The graphs that this produces seem correct, the ET graph is much "bushier" than the decision tree graph.</p>
  
  <p>Am I correct that the DecisionTreeClassifier is the same as a single tree in a RandomForestClassifier and the ExtraTreeClassifier is the same as a single tree in an ExtraTreeClassifier? </p>
  
  <p>Is there any way to do this with all the trees in an actual RDF or ET classifier? I tried using the .estimators_ in the forests but they do not have the export method it seems.</p>
  
  <p><img src="https://i.stack.imgur.com/lFI61.png" alt="Extra Tree Graph"></p>
  
  <p><img src="https://i.stack.imgur.com/Y2isU.png" alt="RDF Graph"></p>