Categories
Analysis Analytics Reflection Strategy

Why Croissants Are King: A Market Basket Analysis

Last week I wrapped up a small but insightful Market Basket Analysis project.

Working off of the bigger Coffee Sales Dashboard project I completed (see here), I decided to explore a bit more and do some data science *tings*.

My goal was to explore how products are frequently purchased together and uncover patterns that could inform cross-selling strategies or promotions.

At first, I kept running into issues with the Apriori algorithm. No matter how I tuned it, the model kept failing to generate meaningful rules. I was just like:

If you haven’t gone through the bang-your-head-on-the-desk rite of passage working in analytics or coding, then you need to share your superpower with world.

As the saying goes:

80% of the job is debugging and cleaning data. The other 20% is explaining why it took 80% of the time.”

After digging deeper, I realized the problem: in the dataset, each transaction only had one item! It’s always the simplest thing that is often the problem, amirite?

Without multiple items per basket, there were no associations to discover and this proved to be a great learning moment. I went back, rebuilt the dataset so that baskets could contain multiple items, and reran the analysis.

Instead of scrapping the project, I realized it’s perfectly fine (and actually really useful) to simulate data. If you’ve never created a dataset before, fear not. I have a tutorial in mind for that!

By redesigning the dataset so baskets could include multiple items, I was able to validate the workflow, uncover meaningful associations (hello coffee + croissant), and learn just as much from the setup as from the results.

TAKEAWAY: It’s okay if the data isn’t “real.” Simulation is a powerful way to practice, experiment, and build intuition—especially when you’re learning or building portfolio projects.

If you’re interested in the technical nitty-gritty, check out my GitHub [HERE] where I have all the code and documentation for this mini-project.

Ardonna •ᴗ•

Ardonna Cardines Avatar

Leave a Reply

Discover more from Mercury Musings

Subscribe now to keep reading and get access to the full archive.

Continue reading