There are already a lot of good articles on the details of Apriori. I am going to mainly focus on a realistic business scenario that might come up around the application of Apriori and Market Basket Analysis.
But it doesn’t hurt to do a quick and high-level refresher on the Apriori algorithm.
Apriori is an association rules mining algorithm that finds what items tend to go with what other items. …
I use the term hacking loosely here but technically it’s correct. I needed to produce a something that wasn’t readily built in to the core of Matplotlib or Seaborn and get by just passing some argument. But if you want to be pedantic, its just a clever workaround.
Feel free to skip the background and jump down to the code. The chart might make more sense though if you read the background.
The business user (we’ll just call Bob from here on) had a set of data that he wanted to display in a particular way.
Bob has a facility…
We had a closet in our old house that we do not want our young boys in for a few reasons — one of them being it was a great spot for hiding gifts. So a while back when I was just getting my feet wet with Python, I wrote a simple script to monitor the door using a Raspberry Pi and a cheap magnetic switch. When the door is opened, it is logged and an email is sent to my wife and I immediately. I’ll admit, I am not very creative with naming… I call it Doorman.
PuLP for Python is an optimization tool like the Excel Solver (COIN-OR PuLP). I had a use case that didn’t quite fit the out of the box examples provided by the writers of this awesome python package. After some trial and error, I was able to come up with a solution that I will review below.
We introduced my 4-year-old son to the classic game of Trouble somewhat recently and he turned out to be probably the luckiest person ever with the game. I swear he rolls a 6 more than everyone else combined but that may just be a skewed view of reality from a Dad that keeps losing to him.
One time, during yet another losing game, I noticed him pause and think on something and it got me thinking. He had rolled a 6, and had a pawn already in play. He seemed to try to think about whether he should move the…