if (FALSE) {
data(mtcars)
grid.search(
formula = mpg ~ .,
data = mtcars,
K = 5L, # Use 5-fold CV
max.lambda = 100, # Search values between 0 and 100
precision = 0.01 # Increment in steps of 0.01
)
grid.search(
formula = mpg ~ .,
data = mtcars,
K = nrow(mtcars), # Use LOOCV
max.lambda = 10000, # Search values between 0 and 10000
precision = 0.5 # Increment in steps of 0.5
)
}
Run the code above in your browser using DataLab