【机器学习】-Wee2 5. 标准方程不可逆(Optional)

Normal Equation Noninvertibility

正规方程 ( normal equation ) 以及它们的不可逆性 ,   这是一种较为深入的概念 

When implementing the normal equation in octave we want to use the 'pinv' function rather than 'inv.' The 'pinv' function will give you a value of \thetaθ even if 

 is not invertible.

If 


 is noninvertible, the common causes might be having :

Redundant features, where two features are very closely related (i.e. they are linearly dependent)
Too many features (e.g. m ≤ n). In this case, delete some features or use "regularization" (to be explained in a later lesson).

Solutions to the above problems include deleting a feature that is linearly dependent with another or deleting one or more features when there are too many features.



在Octave里 有两个函数可以求解矩阵的逆 一个被称为pinv() 另一个是inv() 这两者之间的差异是些许计算过程上的。 一个是所谓的伪逆 ,另一个被称为逆 。使用pinv() 函数将计算出θ的值,  即便矩阵X'X是不可逆的

来源:coursera 斯坦福 吴恩达 机器学习

你可能感兴趣的:(【机器学习】-Wee2 5. 标准方程不可逆(Optional))