small typos

This commit is contained in:
Morten Hjorth-Jensen
2025-09-01 14:00:15 +02:00
parent eb31c10d1c
commit 55beb4d9b8
8 changed files with 143 additions and 101 deletions
+3 -3
View File
@@ -17,7 +17,7 @@ o Scale the data properly
We start with a very simple function
!bt
\[
\f(x)= 2-x+5x^2,
f(x)= 2-x+5x^2,
\]
!et
@@ -88,10 +88,10 @@ print("Closed-form OLS coefficients:", theta_closed_form)
!ec
This computes the Ridge and OLS regression coefficients directly. The identity
matrix $I$ has the same size as $X^T X$. It adds $\lambda$ to the diagonal of $X^T X for Ridge regression. We
matrix $I$ has the same size as $X^T X$. It adds $\lambda$ to the diagonal of $X^T X$ for Ridge regression. We
then invert this matrix and multiply by $X^T y$. The result
for $\bm{\theta}$ is a NumPy array of shape (n$\_$features,) containing the
fitted parameters $\bm{\theta}$..
fitted parameters $\bm{\theta}$.
=== 3a) ===
Finalize, in the above code, the OLS and Ridge regression determination of the optimal parameters $\bm{\theta}$.