Guest User

Untitled

a guest
Dec 10th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. rand_ctrl <- trainControl(method = "repeatedcv", repeats = 5,
  2. search = "random")
  3. grid <- expand.grid(alpha=seq(0,1,0.1),lambda=seq(-10,10,1)) # I think this should be modified
  4. rand_search <- train(Response ~ ., data = train_dat,
  5. method = "glmnet",
  6. ## Create 20 random parameter values
  7. metric = "RMSE",
  8. tuneLength = 5,
  9. preProc = c("scale"),
  10. tuneGrid = grid,
  11. trControl = rand_ctrl)
Add Comment
Please, Sign In to add comment