You are given a Pandas DataFrame `customer_df` with the foll…
You are given a Pandas DataFrame `customer_df` with the following columns: TenureMonths (numeric) MonthlyCharges (numeric, dollars) NumSupportCalls (integer) HasPromoCode (0 or 1) Churned (0 or 1 — the TARGET) Write a short Python script (roughly 10-15 lines) that does ALL of the following, in order: (1) Imports from sklearn everything you will need (train/test split, logistic regression, and the metrics to print a confusion matrix and a classification report). (2) Prepares the feature matrix X (using the four predictor columns) and the target y. (3) Splits the data into 80% training and 20% test, with a fixed random_state for reproducibility and with the class balance preserved in both splits. (4) Creates a LogisticRegression model (allowing enough iterations to converge, and with a setting appropriate for an imbalanced target) and fits it on the training data. (5) Uses the fitted model to produce predicted class labels on the test set. (6) Prints both the confusion matrix and the classification report for the test-set predictions. Use the exact function and method names you learned in class. Short variable names are fine.
Read Details