Skip to content

Commit

Permalink
Updated ridge
Browse files Browse the repository at this point in the history
  • Loading branch information
bpurdy-ds authored Oct 15, 2024
1 parent 0bd84df commit e6eb0f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ If you have two predictors the full equation would look like this (notice that t

$$ \text{cost function ridge}= \sum_{i=1}^n(y_i - \hat{y})^2 = $$

$$ \sum_{i=1}^n(y_i - ((m_1x_{1i})-b)^2 + \lambda m_1^2 + (m_2x_{2i})-b)^2 + \lambda m_2^2)$$
$$ \sum_{i=1}^n\Big(y_i - (m_1x_{1i} + m_2x_{2i}) - b\Big)^2 + \lambda m_1^2 + \lambda m_2^2$$

Remember that you want to minimize your cost function, so by adding the penalty term $\lambda$, ridge regression puts a constraint on the coefficients $m$. This means that large coefficients penalize the optimization function. That's why **ridge regression leads to a shrinkage of the coefficients** and helps to reduce model complexity and multicollinearity.

Expand Down

0 comments on commit e6eb0f4

Please sign in to comment.