The word algorithm has become very popular recently. It has transitioned from something only mathematicians used to something most marketing teams use to promote AI-powered solutions.
During my projects, I realized that some startups just use the word algorithm without really explaining how does the fact that they use algorithms make the project “AI”. I hope that this will article will help you understand the difference between “AI” algorithm and other algorithms.
What is an Algorithm?
Well, let’s start with an easy definition.
Algorithm: process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer. (1)
Basically, the goal of an algorithm is to solve a specific problem, usually defined by someone as a sequence of steps.
For instance, a food recipe to make a cake- that’s an algorithm.
In other words, algorithms are shortcuts that help us give instructions to computers. An algorithm simply tells a computer what to do next with an “and,” “or,” or “not” statement. Obviously, like most things related to mathematics, it starts off pretty simple but becomes infinitely complex when expanded.
It’s important to point out that not all algorithms are related to AI or machine learning specifically.
Algorithms provide the instructions for almost any AI system you can think of.
It sounds great but actually traditional algorithms have an issue. Indeed, you have to tell to create a step by step process to reach your objective. Rather than follow only explicitly programmed instructions, some computer algorithms are designed to allow computers to learn on their own.
What is it?
Machine learning: set of algorithms that enable the software to update and “learn” from previous outcomes without the need for programmer intervention. It is fed with structured data in order to complete a task without being programmed how to do so.
Machine Learning is made up of a series of algorithms. Basically, AI (Machine Learning is a subset of AI) is designed to learn in the same way as a child. Thanks to a dataset, an AI can find patterns and builds assumptions based on those findings.
This is called model-based learning, and it allows AI to make better decisions than humans because it can take many more factors into account and analyze them in milliseconds.
An algorithm is like following a recipe. You follow a set of instructions: prepare the ingredients, heat the oven to 200c, and bake for 10 minutes. The output/result will be to have a great cake.
Now, let’s imagine your oven is too hot. Through Machine Learning, the system learns from the past that the oven gets too hot and so turns it down.
Machine Learning can be compared to an experienced cook (if you have a good dataset). It knows the recipe and has learned a lot from previous experiences. For instance, the system has found out that this ingredient worked well with this cake (based on data) and it would make recommendations/predictions. By using ML, you get something that goes beyond the sum of its parts.
As we have seen an algorithm is a mathematical technique. It is derived by statisticians and mathematicians for a particular task, for instance, prediction.
Algorithms in machine learning aren’t new. At the most basic level, machine learning programs are code. So, they’re code written in Python or Java or some programming language. However, only when they were implemented in the form of a code, the algorithms’ utility increased since computers can handle high computation.
Actually, there is no difference between a “traditional” algorithm and a ML algorithm.
ML vs Classical algorithms
I have seen customers apply similar staging to both machine learning and classical algorithms projects, where you have some experimental development (PoC) then followed by full-scale production.
However, everything else is quite different. I’ll give some examples.
- An ML solution is truly an AI if it is not programmed to perform a task, but is programmed to learn to perform the task
- ML algorithms usually require lesser computation and lesser data to perform reasonably well on many problems which are perfect for some business issues.
- In classical algorithms, statisticians emphasis on p-value more and a solid but comprehensible model
- Traditional learning methodologies such as training a model-based on historic training data and evaluating the resulting model against incoming data are not feasible as the environment is always changing
- A traditional algorithm outputs results, whereas an ML algorithm outputs a model that outputs results.
In most cases, one of the fundamental differences is that ML can have a range of outcomes that are all valid but cannot necessarily be determined upfront.
In my experience, Machine Learning also requires a lot of time to work perfectly. For example, it’s possible for an ML Project running in production to display no errors at all, have completely good behavior from any kind of metric like CPU utilization but still be turning out bad predictions.
In summary, a traditional algorithm takes some input and some logic in the form of code and drums up the output. As opposed to this, a Machine Learning Algorithm takes an input and an output and gives some logic which can then be used to work with new input to give one an output. The logic generated is what makes it ML.
ML algorithm can learn from data while classical algorithms specify the exact rules to find the overall answer.