title: Representing documents in vector space model
body: <p>I have a very fundamental question. I have two sets of documents, one for training and one for testing. I would like to train a Logistic regression classifier with the training documents. I want to know if I'm doing the right thing.</p>
  
  <ol>
  <li>First find the list of all unique words in the training document and call it vocabulary.</li>
  <li>For each  word in the vocabulary, find its TFIDF in every training document. A document is then represented as vector of these TFIDF scores.</li>
  </ol>
  
  <p>My question is: 
  1.  How do I represent the test documents?  Say, one of the test documents does not have any word that is in the vocabulary. In that case , the TFIDF scores will be zero for all words in the vocabulary for that document.</p>
  
  <ol>
  <li>I'm trying to use LIBSVM which uses the sparse vector format. For the case of the above document, which has all entries set to 0 in its vector representation, how do I represent it?</li>
  </ol>