Exercise

Predict probabilities of movie reviews

In this problem, you will build a logistic regression using the movies dataset. The labels are stored in the arrayy and the features in X.

Train the model on the training data. Instead of predicting classes, predict the probabilities that each instance in the test set belongs to each of the two classes.

The logistic regression and train/test splitting functions have been imported for you.

Instructions

100 XP
  • Split the data into training and testing set.
  • Train a logistic regression model.
  • Predict the probabilities for class 0 and for class 1 of the testing data. Class 0 is located as the first column in the predicted probabilities, and class 1 is the second one.