How to Use Tfidftransformer & Tfidfvectorizer?
Scikit-learn’s Tfidftransformer and Tfidfvectorizer aim to do the same thing, which is to convert a collection of raw documents to a matrix of TF-IDF features. The differences between the two modules can be quite confusing and it’s hard to know when to use which. This article shows you how to correctly use each module, the differences between the two and some guidelines on what to use when.
Tfidftransformer Usage
1. Dataset and Imports
Below we have 5 toy documents, all about my cat and my mouse who live happily together in my house. We are going to use this toy dataset to