Resolved: Using x_train_transf in the clf
Why did you use x_train_transf instead of x_train in the cls.fit(x_train_transf, y_train) ?
2 answers ( 1 marked as helpful)
Hey Baker,
Thank you for reaching out and thank you for engaging with the Machine Learning with Naïve Bayes course!
The variable x_train
stores the YouTube comments in the form of strings which the ML algorithm cannot understand. For that reason, we need to transform the data in the form of numbers. This transformed data is stored in the x_train_transf
variable and therefore that is the one we should use in the fitting process.
Hope this helps!
Kind regards,
365 Hristina
This is the code that omitted in the video.
vectorizer = CountVectorizer()
x_train_transf = vectorizer.fit_transf(x_train)