Machine Learning in Five Minutes

If you are in cyber security sales or marketing, then you said the phrase machine learning fifty times this week. You probably also understand machine learning about as well as you do the inertial guidance in Elon Musk’s rockets. The code below is designed to rectify your knowledge gap in five minutes. Let’s start with a conditional:

if wind < gust then open_umbrella fi

This code is obvious: It makes sure the wind is below some gust value before an umbrella is opened. Duh. That little fi ends the conditional. Let’s add to the code:

set gust to 100; if wind < gust then open_umbrella fi

This is also obvious: A value is assigned to gust. Duh. Let’s wrap this in a loop:

repeat set gust to 100; if wind < gust then open_umbrella fi forever

This runs our code over and over forever. Third time: duh. Let’s make a change to our code:

set gust to 100; repeat if wind < gust then open_umbrella fi forever

This change is called an optimization, because it saves the computer from having to reassign the gust value every time the loop iterates. Let’s add more, and we'll reformat the code with line breaks to make it human readable:

set gust to 100;

repeat

if wind < gust then

open_umbrella;

if umbrella_breaks then set gust to wind fi

fi

forever

This code illustrates machine learning. That is, the program learns whether a lower wind value breaks the umbrella and then resets the threshold. This is damn simple, so please be careful with all that bragging you've been doing about advanced machine learning in your product. It is actually much simpler than you thought. Sorry.

(As a bonus complexity debunk: The process illustrated above of making little code changes in successive steps is called Agile Dev/Ops. Please tone down that bragging too.)