목적함수(Objective Function)

Yougurt_Man·2022년 4월 15일
1

Machine Learning Theory

목록 보기
2/18

Keywords

  • Objective Function
  • MSE
  • Independent Variable, Dependent Variable
  • Regression

Objective Function

신경망의 학습능력을 평가하는 지표이다. 출력층의 예측값 (가중치+편향)과 실제값의 차이를 수학적으로 접근하는 기법이다.

The primary focus of this article is the evaluation component (objective functions or loss functions) of the ML tasks, and is divided into the following sections:

  • Objective functions for regression
  • Objective functions for classification

출처: https://medium.com/@bhanuyerra/objective-functions-used-in-machine-learning-9653a75363b5

머신러닝에서, 목적함수는 Regression과 Classification로 나눌수 있다.

Objective Function For Regression

Regression은, Dependent Variable(x값)과 Independent Variable(y값)의 선형 관계를 해석한다.

아래는 모델의 출력값과 가중치와 Feature Vector의 관계를 수학적으로 표현한 것 이다.

예측값 y^(xi,w)=w^0+w^1xi1+w^2xi2+...+w^DxiD\hat y(x_i,w) = \hat w_0+ \hat w_1x_{i1}+ \hat w_2x_{i2}+...+ \hat w_Dx_{iD}

실제값 y(xi,w)=w0+w1xi1+w2xi2+...+wDxiDy(x_i,w) = w_0+w_1x_{i1}+w_2x_{i2}+...+w_Dx_{iD}

Regression은 주어진 모집단 (The population)의 가중치w를 추정하는데에 있으며, Objective Function의 역할은 실제값과 예측값의 가중치w의 (y^y\hat y - y) 잔차를 최소화하는데 목적이 있다. 이때 Regression에서 대표적으로 언급되는 Objective Function은 MSE (평균 제곱 오차)가 사용된다.

MSE

In regression analysis, plotting is a more natural way to view the overall trend of the whole data. The mean of the distance from each point to the predicted regression model can be calculated, and shown as the mean squared error. The squaring is critical to reduce the complexity with negative signs. To minimize MSE, the model could be more accurate, which would mean the model is closer to actual data.

출처: https://en.wikipedia.org/wiki/Mean_squared_error

전체 데이터의 추세를 보기위해서, Regression 분석에서는 Plotting (좌표계에서 x에 대응되는 y값)을 사용하는 것이 자연스럽다. 각 점에서 예측 모델의 평균 거리를 계산해서, MSE로 나타낼수 있다. MSE를 최소화 할 수록, 예측치가 실제 값에 근접하는 정교한 모델을 만들수 있다.

실제값과 예측치의 MSE의 수학적 표현은 다음과 같다.

1Nn=1N(y^y)2{1\over N}\sum\limits_{n=1}^{N}(\hat y-y)^2 | y^\hat y: 예측값, yy: 실제값

참고: 음수값 처리를 위해 제곱을 사용한다.

최적의 가중치를 찾기위해서는, Gradient Descent (경사하강법)이 사용되며, 다음 포스팅에서 이론을 다루도록 하자 !

오늘 끄읕 ~! 배고파..

profile
Greek Yogurt

0개의 댓글