26 julio, 2024

What is the loss function? | Bootcamps

The loss function is a function that is used to optimize our models machine learning. Let’s see in this article how it works in the algorithms of machine learning and in classification problems.

Loss function

The loss function is an incredibly useful method to evaluate how well our algorithm models your data set. If the predictions we make are wrong, our loss function or loss function will generate a higher number. If they are good enough, the loss function will generate a lower number. As we modify our algorithm, the loss function It tells us if we are going down a good path or a bad path.

The formula of the loss function is:

1N

arg min —— ∑ (yi – h (xi))2

NL:1

This equation is the least squares equation or least squears. It is an equation widely used in different spheres. In engineering, for example, it is widely used in 3D design, to calculate meshes or geometric surfaces, among many others.

So, what we have just defined is a loss function. Here there are several very important aspects to mention:

In the equation we have a yi and an h (xi). The first thing to understand is that we apply this function, for example, when we have a set of data in the following way:

S = {(x1, y1), (x2, y2), (x3, y3), … (xi, yi)}

It is basically the mathematical form that we use for supervised learning. When we refer to supervised learning, we only refer to the part in which we denote the data, because in a supervised learning problem what we want is to obtain something like this: y = f (x)

Let’s explain it in parts: in machine learning We have two types of learning, which are supervised learning or supervised learning and unsupervised learning or unsupervised learning. The difference is that in one we use labels and in another not. What does this mean? Well, for example, if we have two categories, such as cars and color, in cars we put Tesla and in color we put blue; then we put Porsche/yellow; etc

carscolorsTeslabluePorscheyellow……

We can predict the color of the car using this data. The cars would be x and the color would be y. What we try in supervised learning is to find a function f (x) (f of x) that allows us to obtain y. This, mathematically, is a mapping that we perform from a function to obtain a resulting value, which in this case would be y.

However, this is not the important thing about this exercise. What is relevant here is how we have defined the data mathematically. What we are saying is that we have a data set consisting of pairs of data, where we have:

carscolorsTeslabluex1, y1Porscheyellowx2, y2……xi, yi

What types of loss functions exist?

There are different types of loss function:

He mean squared error (MSE) or mean square error. Probability loss function or likelihood loss.
Log loss function, cross entropy loss or log loss (cross entropy loss).

Do you want to continue learning about Big Data?

Big Data is one of the areas in which the most jobs are offered. If you want to be one of the lucky ones who can access this type of job options, we have for you the Big Data, Artificial Intelligence & Machine Learning Full Stack Bootcamp, an intensive training in which you will acquire all the theoretical and practical knowledge that will allow you to obtain The job of your dreams. You will be accompanied by the best professionals throughout your training process so that you can achieve the goals you set for yourself. Don’t wait any longer to follow your path to success and request information now!

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *