Reputation: 107
I would like to set the penalty of some coefficients to 0 while using Lasso. The glmnet function has an option called penalty.factor for this purpose. Is there an equivalent in the caret package?
Upvotes: 1
Views: 668
Reputation: 1210
Inside the train function:
model_fit <- train(Data[,-1], Data[,1],method = "glmnet",penalty.factor=rep(1,50),...)
Upvotes: 1