A Guide To Linearity and Nonlinearity in Machine Learning