线性回归与逻辑回归
[J( heta)={1over{2m}}sum_{i=1}^{m}(h_ heta(x^{(i)})-y^{(i)})^2
]
[- 线性回归的损失函数的梯度
]
{partialover{partial heta_j}}J( heta)=sum_{i=1}{m}(h_ heta(x{(i)})-y^{(i)})x_j[- 逻辑回归的损失函数的梯度
]
{partialover{partial heta_j}}J( heta)=sum_{i=1}{m}(h_ heta(x{(i)})-y^{(i)})x_j[
]
[J( heta)={-1over{m}}[sum_{i=1}^{m}y^{(i)}log(h_ heta(x^{(i)}))+(1-y^{(i)})log(1-h_ heta(x^{(i)}))]
]
[J(Theta) = {1over{m}}sum_{i=1}^{m}sum_{k=1}^{K} y_k^{(i)}log(h_Theta(y_k^{(i)})) + (1 - y_k^{(i)})log(1 - h_Theta(y_k^{(i)})) + {lambdaover{2m}}sum_{l}^{L-1}sum_{i=1}^{s_l}sum_{j=1}^{s_{l+1}}Theta_{ji}^{l}
]