Traditional Programming vs Machine Learning

Sravya Reddysetty
4 min readMay 6, 2021

--

Hey all, this is my first article and I’m super excited !! . I have been exploring what exactly machine learning is and how is it different from classical programming for the past few months.

And today, I would like to share my perspective of Machine learning so that even a beginner (In ML) can understand and I will also provide a brief overview of different learning algorithms in ML.

NOTE: This article is mainly intended for beginners who would like to get an overview of ML, if you are already well versed with ML you can skip reading further.

Getting Started !!

I’m a Computer science grad and started working as a developer in an MNC.

Being a developer, one is always concerned about the logic or rules we write to execute certain tasks.

But for a developer to switch into ML career path, he/she will require a change in mindset because in any ML problem they will be building models(not being explicitly programmed) which will predict the output based on the training dataset.

To better understand what exactly I mean, look at the figure below.

Traditional Programming vs Machine Learning

For Example :

As a developer, if we are asked to find the square of a given number, we will simply write a function square(x)= x*x. that would be capable enough to find the square of any given number.

Therefore Classical programming takes the input data and our predefined rules or functions as input and would fetch us the output.

But in any ML problem, we will have only the input and output variables(In supervised learning) and try to find the function which can fit the data set with minimum possible error. So, the data set [(1,1), (2,4),(3,9)…….] are fed as training data set and the model will land in x*x function by understanding the relationship between the input and output values.

Hence the rules from the models can be used to predict values for the new data set in the future.

Now that we have understood the difference between traditional programming and ML. Let us see what exactly ML definition is and what are the different types of ML algorithms.

What is ML?

A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E

Example: Classifying Spam emails

E = Watching you label emails as spam or not spam

T = Classifying emails as spam or not spam.

P = The number (or fraction) of emails correctly classified as spam/not spam

Any ML problem will definitely have all the three terms i.e E, T, and P.

Types of ML Algorithms

  • Supervised Learning: In supervised learning, we are given a data set and already know what our correct output should look like, having the idea that there is a relationship between the input and the output.
  • Example: Classification of mail as spam/ non-spam based on some input data.
Supervised Learning
  • Unsupervised Learning: An unsupervised model allows the model to work on its own to discover patterns and information that was previously undetected. It mainly deals with unlabeled data.
  • Example: Google Photos, where pictures of each person are grouped based on similarities of facial features and asked to provide a label by the user itself.
Unsupervised Learning
  • Reinforcement Learning: The agent/model learns to achieve a goal in an uncertain, potentially complex environment based on the rewards and penalties it receives at every step in the environment.
  • This type of learning is used widely in the gaming industry.
Reinforcement Learning

Conclusion

This is just the overview of ML, and since I am on my learning curve, I would be sharing my understanding of different ML algorithms in my upcoming stories.

Thanks for reading and I hope this article has given you the basic insight into ML.

--

--