title: How to transform items using sklearn Pipeline?
body: <p>I have a simple scikit-learn <code>Pipeline</code> of two steps: a <code>TfIdfVectorizer</code> followed by a <code>LinearSVC</code>.</p>
  
  <p>I have fit the pipeline using my data. All good.</p>
  
  <p>Now I want to transform (not predict!) an item, using my fitted <code>pipeline</code>.</p>
  
  <p>I tried <code>pipeline.transform([item])</code>, but it gives a different result compared to <code>pipeline.named_steps['tfidf'].transform([item])</code>. Even the shape and type of the result is different: the first is a 1x3000 CSR matrix, the second a 1x15000 CSC matrix. Which one is correct? Why do they differ?</p>
  
  <p>How do I transform items, i.e. get an item's vector representation before the final estimator, when using scikit-learn's <code>Pipeline</code>?</p>