Normal Equation Non-invertibility
When implementing the normal equation inoctave we want to use the 'pinv' function rather than 'inv.' The 'pinv'function will give you a value of θ evenif XTX is notinvertible.
If XTX is non-invertible, thecommon causes might be having :
· Redundant features, where two features are very closelyrelated (i.e. they are linearly dependent)
· Too many features (e.g. m ≤ n). In this case, delete somefeatures or use "regularization" (to be explained in a later lesson).
Solutions to theabove problems include deleting a feature that is linearly dependent withanother or deleting one or more features when there are too many features.