Skip to content
Advertisement

Tag: document

Using Sklearn’s TfidfVectorizer transform

I am trying to get the tf-idf vector for a single document using Sklearn’s TfidfVectorizer object. I create a vocabulary based on some training documents and use fit_transform to train the TfidfVectorizer. Then, I want to find the tf-idf vectors for any given testing document. The problem is that this returns a matrix with n rows where n is the

Advertisement