Ridge Regression B Coefficients Calculation
I should be the shape of X'X, only then will matrix addition be permitted. X is generally of shape [n,m], where n is the number of instances (rows) and m is the number of features (columns). Therefore, X'X is of shape [m,m], which should be the shape of I. 
Also note that often when we formulate X, we have a column for the bias terms. Meaning, you might have m features, but X will have m+1 columns, including the bias. 
Hope this helps.
I am trying to calculate the ridge regression B coefficients through this formula in Python:
(X^T * X + λ*I)^(−1) + X^T * y
where:
X^T = X transposed
X^(-1) = inverse matrix of X
Question: What shape should the identity matrix (I) take? X.shape or y.shape?
Thank you for your help!