Machine Learning Week 2 (Additional)
Machine Learning Week 2 (Additional)
发表回复
除了用梯度下降法,我们还有其他方法来求解 的最小值:正规方程法 (Normal Equation)
直接求导数。
Let:
Let:
, For Every j
Solve
结果用矩阵表达是:
Solve
结果用矩阵表达是:
对于n较小的例子,求X的转置和逆都比较快,这样比梯度下降法快。但是如果n较大,比如10,000 左右那梯度下降法比较好。
附推导过程:
https://class.coursera.org/ml-008/forum/thread?thread_id=531
PS: Thank you, Mr. Anonymous ! If the solution derivation infringe on the author's copyright, I will delete that.