daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Feb 24th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Create task with following arguments
  2. task = makeRegrTask(data = data,
  3.                     target = "targetvar",
  4.                     coordinates = coords)
  5.  
  6. #Create learner: statistical learning method to use
  7. lrn_glmnet <- makeLearner("regr.glmnet",
  8.                           alpha = 1, # For LASSO set alpha = 1
  9.                           intercept = FALSE)
  10.  
  11. # spatial CV
  12. rdesc_spatial = makeResampleDesc(method = "SpRepCV", folds = 5, reps = 100)
  13.  
  14. tuning_method = makeTuneControlRandom(maxit = 200L)
  15.  
  16. ## Specifying the search space for lambda tuning
  17. ps = makeParamSet(makeDiscreteParam("s", values = seq(0., 1, by=.01)))
  18.  
  19. set.seed(123)
  20. res = tuneParams(lrn_glmnet, task = task, resampling = rdesc_spatial,
  21.                  control = tuning_method, par.set = ps)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top