1

I am tuning more than 2 hyperparameters, while Generate hyperparameter effect data using the function generateHyperParsEffectData I set partial.dep = TRUE, while plotting plotHyperParsEffect i am getting error for classification learner, its requiring regressor learner

This is my task and learner for classification

classif.task <- makeClassifTask(id = "rfh2o.task", data = Train_clean, target = "Action")
rfh20.lrn.base = makeLearner("classif.h2o.randomForest", predict.type = "prob",fix.factors.prediction=TRUE)
rfh20.lrn <- makeFilterWrapper(rfh20.lrn.base, fw.method = "chi.squared", fw.perc = 0.5)

This is my tuning

rdesc <- makeResampleDesc("CV", iters = 3L, stratify = TRUE)
ps<- makeParamSet(makeDiscreteParam("fw.perc", values = seq(0.2, 0.8, 0.1)),
                         makeIntegerParam("mtries", lower = 2, upper = 10), 
                         makeIntegerParam("ntrees", lower = 20, upper = 50)
                         )
Tuned_rf <- tuneParams(rfh20.lrn, task = QBE_classif.task, resampling = rdesc.h2orf, par.set = ps.h2orf, control = makeTuneControlGrid())

While plotting the tune

h2orf_data = generateHyperParsEffectData(Tuned_rf, partial.dep = TRUE) 
plotHyperParsEffect(h2orf_data, x = "iteration", y = "mmce.test.mean", plot.type = "line", partial.dep.learn =rfh20.lrn)

I am getting the Error

Error in checkLearner(partial.dep.learn, "regr") :
  Learner 'classif.h2o.randomForest.filtered' must be of type 'regr', not: 'classif'

I would expect to see the plot for any more tuning requirement so I can add more hyper tuning, am I missing some thing.

hanzgs
  • 1,498
  • 17
  • 44
  • Not sure what your question is. The error message is clear -- you need to use this on a regression learner, not a classifier. – Lars Kotthoff Apr 23 '19 at 01:28
  • if I use only two parameters (fw.perc, mtries) in the classification tuning, I am getting the plot, if I use more than 2 (fw.perc, mtries, ntrees) I am getting only for regressor Error, Does that how it works? – hanzgs Apr 23 '19 at 01:50
  • 1
    Check the documentation -- partial.dep.learn needs to be a regression learner. – Lars Kotthoff Apr 23 '19 at 02:02
  • It says "The regression learner used to learn partial dependence", as the plot got generated when using 2 hyperparameters in classification, the expectation gave a confusion, Got it, Thanks Lars – hanzgs Apr 23 '19 at 02:08

1 Answers1

2

The partial.dep.learn parameter needs a regression learner; see the documentation.

Lars Kotthoff
  • 107,425
  • 16
  • 204
  • 204