Finishing machine learning commonly used loss function

Machine by the loss of function for learning. This method is a specific algorithm for a given degree of modeling data evaluation. If you deviate far before the predicted value and the true value, then loss of function will be a relatively large value. With the aid of some optimization function, learn to gradually reduce this loss function error between the predicted value and the true value.

All machine learning algorithms are dependent on minimizing or maximizing a certain function, which we call "objective function." This set of functions is minimized is called " loss function" . Loss function is a measure of the performance of the prediction model predictions. Find the minimum value of the function is the most common method "gradient descent." Think of the loss function undulating hills, gradient descent is like sliding down from the top of the hill, looking for the lowest point of the mountains (purpose).

In practical applications, not a general, very good for the loss of function of all machine learning algorithms performance (or do not have a loss of function can be applied to all types of data). Selecting a loss of function of specific issues to take into account many factors, including whether there are outliers, select the machine learning algorithms, gradient descent running time efficiency, whether easy to find the derivative of the function, and the degree of confidence to predict the results.

From the type of learning tasks can be divided into two categories broad sense loss function - return loss (Classification Loss) and classification loss (Regression Loss). In the classification task , we want limited data set from the predicted output value categories , such as a given digital image of the handwritten large data sets, it will be divided into one of 0 to 9. The regression process is predicted continuous value problems, such as a given floor area, number of rooms, to predict house prices.

 Return loss

1. 均方误差(Mean Square Error), 二次损失(Quadratic Loss),  L2 损失(L2 Loss)

均方误差(MSE)是最常用的回归损失函数。其数学公式如:

 

 

 均方误差(MSE)度量的是预测值和实际观测值之间差的平方和求平局。它只考虑误差的平均大小,不考虑其方向。但由于经过平方,与真实值偏离较多的预测值会比偏离较少的预测值受到更为严重的惩罚。再加上 MSE 的数学特性很好,这使得计算梯度变得更容易。

下面是一个MSE函数的图,其中真实目标值为 100,预测值在 -10,000 至 10,000之间。预测值(X轴)= 100 时,MSE 损失(Y轴)达到其最小值。损失范围为 0 至 ∞。

 

Guess you like

Origin www.cnblogs.com/zcj-272/p/11605601.html