I have a simple scikit-learn Pipeline of two steps: a TfIdfVectorizer followed by a LinearSVC.
I have fit the pipeline using my data. All good.
Now I want to transform (not predict!) an item, using my fitted pipeline.
I tried pipeline.transform([item]), but it gives a different result compared to pipeline.named_steps['tfidf'].transform([item]). 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?
How do I transform items, i.e. get an item's vector representation before the final estimator, when using scikit-learn's Pipeline?