Is any full rank feature matrix unitary? If so, why?

124 Views Asked by At

If not, in feature engineering, why is $$X^T(Y-X(X^TX)^{-1}X^TY)=0$$ for a full rank feature matrix $X \in \Bbb R^{nd}$ and response values $Y \in \Bbb R^n$?