Last answered:

20 Aug 2023

Posted on:

11 Nov 2022

0

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)
Instructor
Posted on:

14 Nov 2022

0

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

Posted on:

20 Aug 2023

0

This is the code that omitted in the video.


vectorizer = CountVectorizer()
x_train_transf = vectorizer.fit_transf(x_train)

Submit an answer