Machine Learning Week 2 (Additional)




Machine Learning Week 2 (Additional)


除了用梯度下降法,我们还有其他方法来求解θ 的最小值:正规方程法 (Normal Equation)
直接求导数。

θRn+1   

Let:
, For Every j

Solve 

结果用矩阵表达是: θ=(XTX)1XTy
对于n较小的例子,求X的转置和逆都比较快,这样比梯度下降法快。但是如果n较大,比如10,000 左右那梯度下降法比较好。
附推导过程:
https://class.coursera.org/ml-008/forum/thread?thread_id=531
NormalEquationPage1
NormalEquationPage2
PS: Thank you, Mr. Anonymous ! If the solution derivation infringe on the author's copyright, I will delete that.

Comments

Popular posts from this blog

Malware Report: iauzzy.exe

Malware Report: withme.exe

根因分析之iDice 文章复现