Explainable AI: Part 1

Image by Gerd Altmann from Pixabay

How do you decide if a decision you/someone made was a good decision? Do you just check and see if the outcome was favorable and good? I would hope not.

With this simple logic, if I wanted to get more energy, eating a handful of candy would be a great means to do so since it is cheap and quick (not to mention tasty). Although the initial outcome is the outcome I was looking for, the overall outcome is actually a burst of energy for less than an hour, an energy crash, a possible upset stomach, and more fat to…


The Analytical Method

Image by PIRO4D from Pixabay

Problem

A coin of diameter 1 is thrown on an infinitely large chessboard with squares of side 2.

What is the chance that the coin lands on a position touching both black and white?

Seriously, try to solve this problem first before you continue reading. What are your first thoughts? Here were some of mine:

  1. How do we deal with the infinitely large chessboard?
  2. Do the black and white squares really matter?
  3. 2 coins can fit in 1 square side-by-side.
  4. A coin is a circle, so there are 4 triangular-shaped corners of a square that would be impossible for the circle…

Find the locations of missing products:

Image by Igor Ovsyannykov from Pixabay

Imagine you are an employee that works at Trader Joe’s and are asked to walk around the store and check for shelves that need restocking. Unfortunately, you cannot simply use your handheld inventory scanner to see WHERE exactly a product that was bought was taken from. Supermarkets sometimes have multiple areas where they store a particular product, so it is not easy to keep track of the exact location a shopper took a product from. On top of that, reporting empty shelf spaces for inventory can be time-consuming and there is always the possibility of human flaw. …


Find the inflection points in the following image:

Created in PowerPoint

Sounds easy right? From a human perspective, it’s fairly simple to identify the 2 in this image, but from a computer standpoint, it’s a little trickier than meets the eye. In this post, we will be going through a brute force methodology of finding these inflection points through the use of Python & CV2's contour functionality.

TL;DR

Traverse the contour of the object in a clockwise motion and find the points whose direction is different than clockwise. Here is the GitHub repo.

Contours

Ronel Sylvester

ML Engineer at Predmatic

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store