update week 36

This commit is contained in:
Morten Hjorth-Jensen
2023-09-03 14:05:04 +02:00
parent 22739ad2c9
commit 3f9c0345fd
57 changed files with 4609 additions and 4709 deletions
+1 -1
View File
@@ -888,7 +888,7 @@ for i in range(nlambdas):
lmb = lambdas[i]
Ridgebeta = np.linalg.inv(X_train.T @ X_train+lmb*I) @ X_train.T @ y_train
# include lasso using Scikit-Learn
RegLasso = linear_model.Lasso(lmb)
RegLasso = linear_model.Lasso(lmb,fit_intercept=False)
RegLasso.fit(X_train,y_train)
# and then make the prediction
ytildeRidge = X_train @ Ridgebeta