Skip to content

Commit

Permalink
Fix escaping for regularization example
Browse files Browse the repository at this point in the history
  • Loading branch information
wch committed Jul 18, 2024
1 parent c8c4003 commit 231e234
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/python/regularization/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def plot():
"""
)
# LaTeX
"$$MSE = \\frac{1}{n} \\sum_{i=1}^{n} (Y_i - \hat{Y}_i)^2$$"
"$$MSE = \\frac{1}{n} \\sum_{i=1}^{n} (Y_i - \\hat{Y}_i)^2$$"

"""
Regularization works by adding a penalty to the loss function in order
Expand All @@ -118,9 +118,9 @@ def plot():
parameter/coefficient, and adding them all together.
"""

"$$LASSO = \\frac{1}{n} \\sum_{i=1}^{n} (Y_i - \hat{Y}_i)^2 + \\lambda \\underbrace{\\sum_{j=1}^{p} |\\beta_j|}_\\text{penalty}$$"
"$$LASSO = \\frac{1}{n} \\sum_{i=1}^{n} (Y_i - \\hat{Y}_i)^2 + \\lambda \\underbrace{\\sum_{j=1}^{p} |\\beta_j|}_\\text{penalty}$$"

"$$Ridge = \\frac{1}{n} \\sum_{i=1}^{n} (Y_i - \hat{Y}_i)^2 + \\lambda \\underbrace{\\sum_{j=1}^{p} \\beta_j^2}_\\text{penalty}$$"
"$$Ridge = \\frac{1}{n} \\sum_{i=1}^{n} (Y_i - \\hat{Y}_i)^2 + \\lambda \\underbrace{\\sum_{j=1}^{p} \\beta_j^2}_\\text{penalty}$$"

"""
When using regularization, we must choose the regularization strength
Expand Down

0 comments on commit 231e234

Please sign in to comment.