Machine Learning Notes(II)

The contents are about notes and equations taken from 《Machine Learning》, which is taught by Andrew Ng, in Coursera.

key words: normal equation

Normal Equation

gradient decent 提供了一种最小化 loss function 的方法,用的是不断迭代的方式求 $ \theta $。

normal equation 则是用类似解方程的办法来求 $ \theta $。此外,对于 normal equation 的方法,也不用再去 feature scaling 了。

我们来看一下具体过程:

我们对比一下二者的优缺点。

Gradient Decent Normal Equation
Need to choose alpha No need to choose alpha
Needs many iterations No need to iterate
$ O(kn^2) $ $ O(n^3)$, need to calculate inverse of $ X^T X $
Works well when n is large Slow if n is very large
------本文结束感谢您的阅读 ------
0%