title: How to use a compressed sparse matrix as a training data in XGBClassifier?
body: <p>I have a pandas DataFrame that has 800 columns: </p>
  
  <ol>
  <li>20 columns (continuous features)  have been processed using MinMaxScaler</li>
  <li>the rest of columns (categorical features) is the output of OneHotEncoding.</li>
  </ol>
  
  <p>As a result, my DataFrame is a sparse matrix. </p>
  
  <p>Now I should apply XGBClassifier in order to solve multi-class classification problem. However, I think that it would be a good idea to compress this DataFrame.</p>
  
  <p>I found this method:</p>
  
  <pre><code>from numpy import array
  from scipy.sparse import csr_matrix
  
  A = array([[1, 0, 0, 1, 0, 0], [0, 0, 2, 0, 0, 1], [0, 0, 0, 2, 0, 0]])
  # convert to sparse matrix (CSR method)
  B = csr_matrix(A)
  </code></pre>
  
  <p>However, it is not clear how to use it with sklearn classifiers.
  In general, is it a good idea to compress my DataFrame?</p>