Exercise

# Fit logistic regression model

Logistic regression is a simple yet very powerful classification model that is used in many different use cases. You will now fit a logistic regression on the training part of the telecom churn dataset, and then predict labels on the unseen test set. Afterwards, you will calculate the accuracy of your model predictions.

The `accuracy_score`

function has been imported, and a `LogisticRegression`

instance from `sklearn`

has been initialized as `logreg`

. The training and testing datasets that you've built previously have been loaded as `train_X`

and `test_X`

for features, and `train_Y`

and `test_Y`

for target variables.

Instructions

**100 XP**

- Fit a logistic regression on the training data.
- Predict churn labels for the test data.
- Calculate the accuracy score on the testing data.
- Print the test accuracy rounded to 4 decimals.