Classical programming vs. Machine Learning in plain English

Panagiotis (Panos) Papaemmanouil
CodeX
Published in
3 min readJun 18, 2022

The “email spam detection” example

Challenge: How would you teach a technical concept to a friend without any relevant experience?

In this short article, I attempt to explain how Supervised Machine Learning is differentiated from classical programming, using the email spam detection example.

🎥 Also, there is a video version of this article here: https://youtu.be/AWvJ1pt8CxQ

Why do we need Machine Learning?

Many colleagues of mine ask me why there is so much hype around Machine Learning. Isn’t classical programming good enough? What’s an easy example demonstrating the need for Machine Learning over traditional programming? 🤔

That’s why I’ve decided to write a SIMPLE blog post to explain in plain English what Machine Learning is and how it differs from classical programming.

Classical Programming vs. Machine Learning

This image summarizes the core conceptual differences between Classical Programming and Machine Learning.

Let me explain it with a familiar example.

Assume that we want to write a program to identify if an email is a spam or not. 📧

In classical programming, we need email data and a set of rules to categorize emails. Therefore, we need to engage a human expert who will be able to determine rules capable of identifying an email as spam.

Such rules might be, for example, if an email contains the phrase “you are the big winner” or “I want to give you money”. Another case might be if an email comes from an unknown sender and talks about a prince and his massive fortune he wants to share with you, or if the email has multiple recipients worldwide.

You get the point!

💡Basically, we need to extract specific characteristics from emails (these characteristics are called Features in ML terminology) and apply our custom rules to them.

These rules combined will probably be able to categorize an email as spam or not. But it’s clear that the manual generation of these rules is a complex and painful process because it requires a human expert to develop them, and in the end, we can not be sure about the importance of each rule and the final performance of our program.

Here is where Machine Learning comes into play. 🤖

Machine Learning programs are also built on top of data, but the core distinction is that we don’t need any rules beforehand. Instead, we need a set of pre-categorized emails to train a Machine Learning model using them. After the training phase, the Machine Learning model will have developed its own rules, and it will be able to automatically identify an email as spam or not.

In conclusion, both classical programming and Machine Learning need data. But the main difference is that the human has to develop the rules in classical programming, while in ML, the machine can generate the rules based on the annotated data.

Thank you very much! See you at the next one!

Get in touch

I hope you liked this article. If you have any questions or just want to introduce yourself, don’t hesitate to reach out!

My name is Panos (Panagiotis) Papaemmanouil, and here are my contact details.

--

--

Panagiotis (Panos) Papaemmanouil
CodeX
Writer for

Mathematician turned Data Scientist turned Technology Entrepreneur. Passionate about data-driven real-world problems. | LinkedIn: https://bit.ly/3O34W3Y