November 2018
Beginner to intermediate
182 pages
4h 48m
English
By simply passing a flag to the CountVectorizer step, we can remove the most common stop words. We will specify the language in which the stop words we want to remove are written. In the following case, that's english:
lr_clf = Pipeline([('vect', CountVectorizer(stop_words='english')), ('tfidf', TfidfTransformer()), ('clf',LR())])lr_clf.fit(X=X_train, y=y_train)lr_acc, lr_predictions = imdb_acc(lr_clf)lr_acc # 0.879
As you can see, this is not very helpful in improving our accuracy. This would indicate that the noise added by stop words is being removed or neglected by the classifier itself.
Read now
Unlock full access