update week 36
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user