Question: In the code cell below, you will transform the features into numerical vectors using ` TfidfVectorizer ` . Task: Follow the steps to complete the
In the code cell below, you will transform the features into numerical vectors using TfidfVectorizer
Task: Follow the steps to complete the code in the cell below:
Create a TfidfVectorizer object and save it to the variable tfidfvectorizer
Call tfidfvectorizer.fit to fit the vectorizer to the training data Xtrain
Call the tfidfvectorizer.transform method to use the fitted vectorizer to transform the training data Xtrain Save the result to Xtraintfidf
Call the tfidfvectorizer.transform method to use the fitted vectorizer to transform the test data Xtest Save the result to Xtesttfidf
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
