title: How do I do classification using TfidfVectorizer plus metadata in practice?
body: <p>I am using trying to classify some documents into two classes, in which I use TfidfVectorizer as an feature extraction technique.</p>
  
  <p>Input data consists of rows of data containing about a dozen fields of float data, label and the text blob of the body of the document. In order of use the body, I applied the TfidfVectorizer and got a sparse matrix (which I can examine by converting to array via toarray() ). This matrix is usually very large, thousands by thousands dimensions - let's call this F which has size 1000 x 15000.</p>
  
  <p>To use a classifier in Scikit, I give it an input matrix X which is (number of rows * number of features). If I do not use the body, I have maybe an X of size 1000 x 15.</p>
  
  <p>Here is the problem, suppose I append horizontally stack this F to X, so X will become 1000 x 15015, which introduces a few problems:
  1) The first 15 features will be playing a very little role now;
  2) Out-of-memory;</p>
  
  <p>Scikit has provided an example where using solely the TfidfVectorizer input, but shed no light on how to use it <em>along side</em> the metadata.</p>
  
  <p>My question is: <strong>How do you use the TfidfVectorizer output along with the metadata to fit into a classifier for training?</strong></p>
  
  <p>Thank you.</p>