Foi usado o código: Obs.: data['sentiment'] já está binária
xtrain, ytrain, xtest, ytest = train_test_split(bag_of_words, data['sentiment'], random_state=42)
lr = LogisticRegression()
lr.fit(xtrain, ytrain)
porém, a saída é
TypeError: A sparse matrix was passed, but dense data is required. Use X.toarray() to convert to a dense numpy array.