Hello. It's been a while since I last wrote on the blog. I've been very busy but managed to carve out some time, albeit limited, to study. Now that I've completed my personal study journey on statistics (although I keep forgetting and having to review every concept, darn memory), I've started learning the basics of machine learning, and later on, I'll move on to AI. Don't worry, I'll keep you informed about this journey until the end. So, this is the opening article in the series on the basics of machine learning; let's arm ourselves with patience and start this new journey together.

What is machine learning?

We must start with this brief but complex question. To answer simply, machine learning is an approach through which we program the computer to perform tasks, generally calculations, on our behalf.

To put it plainly, "classic" programming of a computer involves writing precise instructions with a programming language that the computer must execute to produce a specific output. Everything is defined by the user, every single step. In the context of machine learning, however, we write code with less precise instructions—let's say interpretable by the computer using statistical and probabilistic methods—but what the user defines are simply some parameters that they want the computer to adhere to.

Let's make a simple analogy to understand the differences between "classic" programming and programming for "machine learning."

Classic programming can be compared to asking a friend to make you a chocolate cake by giving them precise instructions, ingredients, and quantities to use. Programming for machine learning, on the other hand, can be seen as asking your friend to make you a chocolate cake, but you only give them the ingredients and quantities; then they decide on their own, using statistical methods, the correct and best way to assemble the ingredients to produce the desired cake.

To make a more mathematical comparison and closer to reality, we can say that in classic programming it's possible to know the value of y as a function of x because we define the function that must be executed to generate y from x, i.e., we say that y = f(x) = B0 + B1•X = 0 + 2 • 3. In programming for machine learning, we tell the computer that we want to obtain a certain y but leave it to predict the function or the coefficients to use to achieve the correct y.

So remember this as a sort of mantra:

"In machine learning, what is directly estimated is the function (f(X)) that produces the target variable y given one or more response variables X."

It's important to understand a crucial aspect of machine learning, that we are not always capable of interpreting and knowing the function that has been estimated; sometimes it appears as a true "black box," and increasingly sophisticated methods are being developed to interpret very complex estimated functions. In simple terms, recalling the earlier comparison, sometimes our friend predicts the procedure for making the chocolate cake but it is so complex that we cannot reconstruct it.

Okay, okay. So here we repeat our mantra:

"In machine learning, what is directly estimated is the function (f(X)) that produces the target variable y given one or more response variables X."

Therefore, in machine learning, our goal is to predict the function f that produces y given an x, hence y = f(x). There are two approaches to doing this:

  • Parametric approach: This approach is also defined as model-based, indeed it approximates the possible shape of f(x) a priori and tries to adapt this approximation to the training data, adjusting our approximation to find the form of f(x) closest to the real one. And you know what we call this approximated function that we try to adapt to the training data? Model. Here's another keyword you've heard a thousand times and more. A model is nothing but a simplification of the real function f(x) just like a globe is a function of planet Earth or like the normal probability distribution of a biological variable is an approximation of the real probability distribution associated with it. Just to give you an example. The linear regression function is a model used to approximate the real function that produces the value of y given a certain value x when they are in linear relation to each other, but don't worry. We'll come back to it. In this parametric approach, what is really estimated are the parameters of the model function that we've decided to use to make it more effective in producing the real y.
    -Non-parametric approach: This approach, on the other hand, is defined as data-based, here we don't define a model form of f(x) a priori; instead, we directly estimate the real shape of the function based on the observed data. Obviously, this approach requires many, many more data to have a correct estimate of f(x).

Machine learning is extremely fascinating because there are various tasks that can be performed thanks to machine learning such as regression, classification, dimensionality reduction and clustering of data.

Finally, I would like to remind you that there are different paradigms with which these tasks can be performed. Generally, three main methodologies of machine learning are identified:

  1. Supervised Machine Learning: It's like asking your friend to bake a chocolate cake by giving them an already made cake as a reference. So, we feed the model examples where y is known.
  2. Unsupervised Machine Learning: It's like asking your friend to bake a chocolate cake without giving them any cake as a reference. Therefore, we do not provide the model with examples of y during its training process.
  3. Reinforcement Machine Learning: It's like asking your friend to bake a chocolate cake without giving them any cake as a reference, but giving them a reward if they are doing it right (for example, a hug) or a penalty (choose your best penalty example) if they are doing it wrong during the preparation of the cake.

Do not worry I will talk about this in deep in next articles, for know just know it.
Well, for this very first article on machine learning, I think we'll stop here. I hope you enjoyed this article. If you want to add, deepen, or correct any concept discussed, feel free to do so in the comments.

Goodbye and see you soon.