title: ExtraTreesClassifier with sparse training data?
body: <p>I am trying to use an <code>ExtraTreesClassifier</code> with sparse data, as per <a href="http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.ExtraTreesClassifier.html#sklearn.ensemble.ExtraTreesClassifier.fit" rel="nofollow">the documentation</a>, however I do get a run time <code>TypeError</code> asking for dense data. This is on scikit-learn 0.17.1, and below I am quoting from the documentation: </p>
  
  <p><code>
  Parameters: 
  X : array-like or sparse matrix of shape = [n_samples, n_features]
  </code></p>
  
  <p>The code is quite simple: </p>
  
  <pre><code>import pandas as pd
  from scipy.sparse import coo_matrix, csr_matrix, hstack
  from sklearn.ensemble import ExtraTreesClassifier
  import numpy as np
  from scipy import *
  
  features = array([[1, 0], [0, 1], [3, 4]])
  sparse_features = csr_matrix(features)
  labels = array([0, 1, 0])
  
  classifier = ExtraTreesClassifier()
  classifier.fit(sparse_features, labels)
  </code></pre>
  
  <p>And here the exception: <code>TypeError: A sparse matrix was passed, but dense data is required. Use X.toarray() to convert to a dense numpy array.</code>. This works fine when passing in <code>features</code>.</p>
  
  <p>Looks like the documentation is out of date or is there something wrong with the above code?</p>
  
  <p>Any help will be greatly appreciated. Thank you. </p>