Haleh
Haleh

Reputation: 31

graphlearning with two part of tuning and not tuning with both under CV resampling

I want to have a mlr3 pipeline that the first pipe is filtering without tuning, and then it follows with classifiers with tuning. I want the both part be inside CV, but only second part be on gridsearch.

pipe=   po("filter", filter = flt("anova") ,filter.frac = .5) %>>%  
  po("pca", rank.=10) %>>% po('learner', lrn('classif.log_reg', predict_type = "prob"))
plot(pipe)

paramset <- ParamSet$new(list(
  ParamDbl$new("classif.log_reg.epsilon", lower = 0, upper = .000001 ),
  ParamDbl$new("classif.log_reg.maxit", lower = 5, upper = 40,tag = 'budget' )#,

))

I am using TuningInstanceSingleCrit and whole my graph is going through grideasrch which cause lots of extra time. these are part of settings:

 instance <- TuningInstanceSingleCrit$new(
  task = task,
  learner = grf_lrn,
  resampling = cv10,
  measure = msr("classif.auc"),
  search_space = paramset,
  terminator = trm('none')
 
)

I am wondering how I can have CV run on all graphlearner but gridsearch only apply to classif.log_reg. for example I want to have for each fold, Anova be calculated and pass to LR and tuning be done only on LR.

Thanks.

Upvotes: 0

Views: 24

Answers (0)

Related Questions