Exercise

Logistic regression of movie reviews

In the video we learned that logistic regression is a common way to model a classification task, such as classifying the sentiment as positive or negative.

In this exercise, you will work with the movies reviews dataset. The label column stores the sentiment, which is 1 when the review is positive, and 0 when negative. The text review has been transformed, using BOW, to numeric columns.

Your task is to build a logistic regression model using the movies dataset and calculate its accuracy.

Instructions

100 XP
  • Import the logistic regression function.
  • Create and fit a logistic regression on the labels y and the features X.
  • Calculate the accuracy of the logistic regression model, using the default .score() method.