← All projects

Coupon Acceptance Prediction

Complete · Group project (2 people), data preparation and logistic regression

A university machine learning project (QUT IFN580) using a dataset of 12,684 driving scenarios to predict whether a driver accepts a coupon. I handled data preparation, which meant dropping unusable columns, imputing missing values, parsing mixed text and number fields, one-hot encoding and a correlation analysis. I also built the logistic regression model, tuned with GridSearchCV. Luke built the decision tree and neural network. For my individual part, I compared all three saved models on a new test split using accuracy, ROC curves and AUC, and the neural network came out as the best model.

UniversityMachine LearningPython

Updates

Most of machine learning is cleaning the data

For a uni machine learning project, we predicted whether a driver would accept a coupon offer, using a dataset of 12,684 driving scenarios with 26 variables. I owned data preparation and the logistic regression model. Data prep took far longer than the modelling.

What the data threw at me:

  • A column that was almost empty. One variable was missing in about 99% of rows. No imputation rescues that, so it went.
  • Small gaps worth filling. Several “how often do you visit X” columns were missing 1 to 2% of values. Those were worth imputing rather than throwing rows away.
  • Numbers that aren’t numbers. Age mixed values like 21 and 26 with text like below21 and 50plus. Time was stored as strings like 10AM. Both needed converting before a model could use them.
  • Variables that repeat each other. Some binary columns were very highly correlated. A correlation heatmap made those easy to find and drop.

Then the models. I built and tuned the logistic regression with GridSearchCV, and my teammate Luke built the decision tree and neural network. For my individual part, I compared all three saved models on a fresh test split using accuracy, ROC curves and AUC. The neural network came out on top.

What I’d tell myself at the start: read every column before touching a model. Classifying each variable as binary, ordinal, nominal or numeric up front saved me from encoding mistakes later.