The Golf Ball Theory — Easy ML

Original article was published on Artificial Intelligence on Medium

The Golf Ball Theory — Easy ML

An Introduction to machine learning and statistical modelling.

Tiger Woods computing Ŷ estimations.

#QOTD: “We can only see a short distance ahead, but we can see plenty there that needs to be done.’’ — Alan Turing (Mathematician, Father of computer science and Artificial Intelligence).

Tech for the non-tech !

As a mathematics and computer science graduate, I noticed very early on two elements that shaped the way I conceive, understand, create and imagine things in my mind. Check this:

  1. Most events and phenomenons can be explained through the insatiable power of mathematics,
  2. The language of mathematics isn’t an easy one to learn and understand.

That being said, for the sake of my personal growth in the matter, I had to find creative ways to explain to myself first, then to others those mathematical concepts in an accessible language using easy and real life example that I could relate to.

The golf ball theory is an intuitive approach theory aiming to introduce a non-tech person to a high level, and very clear understanding of machine learning processes with a hint of statistical modelling.

By the end this article you will be able to critically design your own experiments and if you’d like to extend your knowledge i’ll advise you to learn about some of the most used machine learning algorithms such as the polynomial regression, the decision tree (regression or classification) or the logistic regression. This is more than enough to start with, trust me.

So the Golf Ball Theory.

You, my friend, have now to step in the shoes of a golfer, but not just any golfer. We could certainly use Tiger Woods, one of the most famous golfer of all times. Congrats to you !

Let’s imagine…we are in a tournament and it is your turn to play. You have to throw a swing to hit the ball the best way possible to put it the hole with the least number of hits. As a professional player you know the rules, moreover you also consider some variables that could impact the final result of the hit.

Now imagine… you are getting ready to hit the ball, it’s a pretty sunny day, the wind isn’t blowing much, birds are chirping, the crowd is watching you including the people that care the most about, you have all the clubs you need, you did all the small supersticious tweaks that you always do before hitting the ball.

Before hitting it though you’re making a short assessment, as usual… and you start asking yourself a series of questions going from the most predictable to the least ones:

  • which golf club should I use ?
  • How what is the temperature, is hot enough?
  • How many people is there in the crowd? is everybody watching ?
  • What is the direction of the wind ?
  • How hard should I hit the ball ?
  • How fare is the hole ?
  • and so on…

You come to realize that some variables are useful for you to “know” -(predict) the end result of the hit. So you start paying attention to the relevant ones, the direction of the wind, the golf club you will use, the strength you will hit the ball with and probably a couple more, but in the end you only consider a handful of them.

Congrats, you have now consolidate your dataset and performed a dimensionality reduction which is often times one of the first steps of machine learning predictions. By considering the variables that could impact the final result of the hit, you gathered information or data. By only considering the most important variables, you went from X number of variables to X-n number of variables, in other other words you have less variable to look at but a better quality dataset.

Let’s carry on with the introduction to #ML. If you have made it to this line you have done well, the best is yet to come keep it going !!

Thinking objectively

The model

Another thought before hitting the ball is :

“which technique will be the most suited for this hit, using this specific club at that specific distance, on a sunny day?”

You now start imagining the results of every single possible hit considering the underlying variables (the weather conditions, the distance, the club type and the strength).

So you come up with the list that might look like this, let’s assume:

  • If your left arm is too high, being right handed, you might end up putting too much strength or not enough in your swing.
  • If you do not keep your eyes on a specific place of the course, you might hit the ball at the wrong place.
  • If your waist doesn’t swing correctly with the rest of your body, you might alter your strength or hit the ball in the wrong direction.
  • and certainly more…

You go ahead take a hit! All the conditions are gathered for you to score but unfortunately you hit the grass and the ball goes right in the water about 20 meters far from the hole… What a disaster. But you’re not done yet !

Remember, you’re a professional player, you’ve done this for many years, you have hours of practice on the clock, you also know your equipment very well and know how to deal with different weather’s conditions, so you concentrate a bit more and change your position and try again.

You have it all under CRTL. So hit the ball again, and bang ! right in the hole this time, just like you assessed it ! Hurray, better than Tiger Woods, we have “place_your_name” Woods 🙂

Congrats again ! You’ve made it to the end of the golf ball theory. By reading this you have computed several very important steps. First, you have selected your model by choosing a certain body position. Second, you have generated some predictions when making assumptions about the final result of the hit. Third, you have tuned your model by changing your body position and focusing a bit more before the second hit. Next, you have compared your predictions to the actuals. Lastly, you have assessed the fit of your model by looking how far in the water the ball landed.

This was, as presented, a very intuitive introduction approach theory to machine learning and statistical modelling. The beautiful point about this theory is that if you use an easy and real life approach you can model almost any problem and explain them to more or less anybody.

I truly believe that most statistical models used in machine learning are designed thoughts explained in the universal mathematical language. In other words, if you’re a “critical thinker” you may already use some of those algorithms, in your head, under different names and definitions.

Let me know if you have understood something, if you have appreciated the reading and if you have any feedback ! Je suis preneur 🙂

And yes you can put on your Master’s green jacket my friend.

catch me on Twitter, LinkedIn or by email: up.koudou@gmail.com #AiForEveryone