Predict Next-Month Orders: Train/Test Split, Pipeline, and AUC
Context
You are given a cleaned tabular retail dataset as a pandas DataFrame df. The binary target column will_order_next_month indicates whether a customer will place an order in the following month (1 = yes, 0 = no).
Tasks
-
Split the data into 80/20 train–test sets with stratification on the target.
-
Build a reproducible scikit-learn pipeline that:
-
Standardizes numeric features.
-
One-hot encodes categorical features (robust to unseen categories at test time).
-
Train a gradient-boosted tree model (e.g., XGBoost or LightGBM).
-
Report ROC AUC on the held-out test set.
-
If AUC is low, list two techniques you would use to improve model generalization.
Hints
-
Demonstrate scikit-learn pipelines and proper evaluation.
-
Use
ColumnTransformer
to preprocess numerics and categoricals in one pipeline.
-
Ensure reproducibility with fixed random seeds.