Why Machine Learning over traditional programming?

Subscribe to my newsletter and never miss my upcoming articles

Why Machine Learning?

A while back, I posted this question on Twitter and it attracted a lot of folks and the reason might that when done effectively, machine learning applications can seem like magic.

The single most reason why Machine Learning has become the headline of the internet is that it solves complex problems so easily.

Let’s say you wanted to build a spam classifier that would detect an incoming email and classify it as spam or not spam. With traditional programming, you could hard code rules of what makes email spam or not spam.


You could enter some target words in the program which characterizes a spam message but this would not always be accurate. Why? An example is that not every message with typos is spam or email from someone with average language skills...The result is that you would always have to change the target words and so on. Thus complicating things.

But what if this would be done easily with machine learning? By building a classifier powered by machine learning, we only have to show the model examples of spam & non-spams and thus it can learn to guess if any incoming message is spam or not. And this is in fact how our email providers are built.

Machine Learning is not suited to solve every single problem. There are problems that traditional programming is well suited for that ML would not.

What types of problems ML is suited for and what is not?

This can sound silly, but do you have a hammer that you use to slice a pie? Probably not.

This is no different from what problems that Machine Learning can solve. Like other tools, there are what it is suited for and what it is not.

Machine Learning is suitable for problems which are:

  • Very clear and simple to formulate. These include yes or no questions (eg: email is yes or not spam), or predicting a single variable such as the price of a house given the number of bedrooms, region,...

  • Hard to be solved by traditional programming: How many rules would you have to write when implementing a face detection algorithm without using machine learning? That would be a complex program and less accurate. How about sentiment analysis?

  • Deep and resonate some forms of intelligence. An example of this is often in machine vision and language processing. Machine Learning (Neural Networks specifically) has shown potential in object recognition & detection, voice synthesis, machine translation, etc...These tasks are nearly impossible to hard code, so Machine Learning makes it easy.

However, Machine Learning is not suitable for projects:

  • Which are expected to change the world in a matter of hours.
  • Which are expected to change the world without good data.
  • Which can be solved easily with traditional programming.
  • Whose patterns are very clear and constant.

That's it for this week. I am active on Twitter and LinkedIn. If you would like to connect/chat, you're welcome. Every day, I share one or two things that you may find insightful.

...Until the next time!

No Comments Yet