mDe
mDe

Reputation: 107

Equivalent of penalty.factor in caret?

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

Answers (1)

Fra_Ve
Fra_Ve

Reputation: 1210

Inside the train function:

model_fit <- train(Data[,-1], Data[,1],method = "glmnet",penalty.factor=rep(1,50),...)

Upvotes: 1

Related Questions