머신러닝
MSE, cost function
★ ☆
2021. 1. 10. 11:25
$$J(\theta_{0},\theta_{1}) = \frac{1}{2m}\sum_{i=1}^{m}(\hat{y}_{i}-y_{i})^{2} = \frac{1}{2m}\sum_{i=1}^{m}(h_{\theta}(x_{i})-y_{i})^{2}$$
Hypothesis Function의 정확도를 cost function으로 구할 수 있다. 대개, cost function 값이 낮을 수 록 정확도가 높다. Cost function의 형태에 따라 달라질 수 있다.
Mean Squared Error는 대표적인 cost function 중의 하나이다.
$$h_{\theta}(x_{i})$$는 hypothesis function의 결과 값이며, $$y_{i}$$는 실제 값이다.
*이해되지 않는 설명
The mean is halved (1/2) as a convenience for the computation of the gradient descent, as the derivative term of the square function will cancel out the (1/2) term.
Gradient descent 계산할 때 도움이 되기 위해서 mean을 절반으로 나눈다. 제곱 함수를 미분하면 1/2는 의미가 없어진다.