The fundamental idea of Machine Learning is to “somehow” teach a computer to decide or predict like a human-being, but how on earth a device consisting of some sorts of circuitry can even achieve this?
Probably, people who are reading this article have watched the Imitation Game. One of the breaking points from that film for me was these words of Alan Turing: “ Of course machines can’t think as people do. A machine is different from a person. Hence, they think differently. The interesting question is, just because something, uh.. thinks differently from you, does that mean it’s not thinking? Well, we allow for humans to have such divergences from one another. You like strawberries, I hate ice-skating, you cry at sad films, I am allergic to pollen. What is the point of…of… different tastes, different… preferences, if not, to say that our brains work differently, that we think differently? And if we can say that about one another, then why can’t we say the same thing for brains… built of copper and wire, steel?”
Now, let’s return to our fundamental question: How a computer can even decide on or make a prediction about something? A computer has only one single but precious skill: “computing”. The only thing that we can do with computers is to do some math! Computer Scientists found perfect ways to use this single skill to achieve thousands of different tasks.
Machine Learning is all about transforming real world data into numbers, and processing them. For example, a picture is represented in a computer as a huge matrix that includes all the data about each pixels’ color as RGB. A classification algorithm “somehow” uses these numbers and classifies the objects within the picture.
Let’s dive into the “somehow”. In Machine Learning, there are Supervised, Unsupervised and Semi-supervised techniques in order to achieve a goal. In this article as an introduction, I will mostly talk on the supervised techniques.
Think about an algorithm that makes predictions about a baby’s birth weight with respect to some parameters such as mother’s age, duration of pregnancy, race etc. This algorithm is like a function that takes parameters, processes them and returns a result.
function (mother’s age, duration of pregnancy, race){
result = mother’s age x its weight + duration of pregnancy x its weight + race x its weight ;
return result;
}
The purpose here is to find the most proper “weights” for all parameters that the function takes. If we can achieve to find them, then this function will return true results approximately. But how can we optimize these parameters i.e how can we find the proper values for each weight?
Here, the concept of “cost function” comes. At the beginning, we do not have any weights therefore, initially we assign them as randomly. Then, we define a “cost function” or equally an “error function” that represents the error for each prediction. The key point here is when the error is minimized, then the accuracy is maximized. A cost function is the difference between the real value of a baby’s weight and the prediction that our algorithm makes in this case. Because here we use the actual value of a baby’s weight, this algorithm is named as a supervised one. At the training phase, in each iteration, by using this function, we make a prediction, we compare the result with the real value, according to the error, we change the parameters by using different optimization techniques in order to find the global minimum for the cost function, and the global maximum for our accuracy at the same time. For this process, the most used technique is “Gradient Descent Algorithm”.
After the training phase, we now have a function with proper weights. By using different “samples” i.e different parameters for different babies, we can test the model and see the results’ accuracy. The more it is accurate, the successful our model is.
In Machine Learning, there are various cost functions, optimization algorithms, and training methodologies. Because this is an introduction article, I will not dive into them. For further information, you can see:
- https://developers.google.com/machine-learning/crash-course/ml-intro
- Machine Learning Refined: Foundations, Algorithms, and Applications by Jeremy Watt, Reza Borhani, and Aggelos K. Katsaggelos
Thank you for your time!
Credit: BecomingHuman By: Alperen ÜGÜŞ