Examples of using pandas .pipe()

What I did

What I learned

What I will do next

Random Aside

I was doing some interview practice and typed these up while talking about beta coefficients. Figured I might as well leave them here. The regression equation: \(y=\beta x + \beta_0\) where:

\[\beta = \frac{S_{xy}}{S_{xx}} \\ \beta_0 = \bar{y} - \beta\bar{x} \\ S_{xy} = \sum(x-\bar{x})(y-\bar{y}) \\ S_{xx} = \sum(x-\bar{x})(x-\bar{x})\]

The multiple regression equation for OLS is: \(\beta = (X^T X)^{-1}X^T y\)

This would work for linear regression, too, and is how you would actually probably want to calculate it in code because of the optimization processors have for vectorized operations.

Note that \(X\), the design matrix or matrix of regressors, is assumed to be full rank. This means that each row is linearly independent (makes sense, you ) and the matrix is invertible. You can test it’s full rank by making sure the determinant is non-zero.