0

How do you train a linear regression on a training-set with a single regularization constant lambda, λ = 0.01? I need to do it in python.

I need it for the outer-loop in 2-level-cross validation. when training with the optimal lambda found.

I know how to fit the regression, but not how to use the lambda:

import sklearn.linear_model as lm

model = lm.LinearRegression()
model.fit(X, y)

# Predict alcohol content
y_est = model.predict(X)
Ida
  • 31
  • 2

0 Answers0