mlr-org / mlr

Machine Learning in R
https://mlr.mlr-org.com
Other
1.64k stars 404 forks source link

allow threshold tuning in tuneWrapper #83

Closed berndbischl closed 9 years ago

berndbischl commented 10 years ago

Either have option or add the old wrapper for that.

option might be simpler.

jakob-r commented 9 years ago

an option for tune.threshold within the tuneWrapper makes it a bit nasty IMHO i just noticed. Maybe bring back a wrapper. You can always wrap wrappers. So it should be okay, no?

jakob-r commented 9 years ago

What about this kind of implementation? (Yes - it is an option and no seperate wrapper) cd4e140110ca1231ead45f75e9ed4687de76f973

berndbischl commented 9 years ago

I needed to revert this. sorry. I have to release 2.2 today! You code is not lost but in history.

We need to discuss this. One thing that came to my mind: Should this thresh-tuning not also be done during normal calls to tuneParams?

berndbischl commented 9 years ago

We agreed today that it might be good to a) have an option for this in OptControl b) do the tuneThreshold in evalOptState c) bonus: store the threshold in opt path

jakob-r commented 9 years ago

a) You mean i should put this option in each version of makeTuneControlGrid, makeTuneControlMBO, ... ? Like makeTuneControlGrid(..., also.tune.threshold = TRUE)

jakob-r commented 9 years ago

should be finished here e60893b92a4d558282095c1e25cf8a586c57f397 please reread

berndbischl commented 9 years ago

Review:

1) assertFlag exists 2) We wanted to have this for FeatSel, too. We should do as many arg checks in the base class as possible.

3)

      if (!learner2$predict.type == "prob")
        stop("'tune.threshold = TRUE' requires a learner with the predict.type prob")
      tune.th.r = tuneThreshold(r$pred, getFirst(measures))

This check is bad on many levels: a) The check should be done in tuneThreshold. Maybe it is already there. IF you want an extra GOOD check you should do it before computation starts. Not in the middle of it.

berndbischl commented 9 years ago

I am currently on it.

berndbischl commented 9 years ago

Regearding 3): The check is on setThreshold, which seems OK.

berndbischl commented 9 years ago

3) I added that check to checkTuneParset. This is where it should be.....

berndbischl commented 9 years ago

4) Please make sure the option is added for all FEatSelControls

5) We need unit tests for tuning and featsel. Both with multi- and binary class, because both are different

berndbischl commented 9 years ago

6) Make sure you read what I did.

Now take over.

jakob-r commented 9 years ago

more is done here 675f3343105c5a5a2e50771b477af316a8cbac69

jakob-r commented 9 years ago

please review again

berndbischl commented 9 years ago

I am reviewing this now, 2 notes for later:

1) The tuning (in the unit test) seems a bit slow.

2) Do we need to support this for multi criteria tuning as well? How / can we handle this there?

berndbischl commented 9 years ago

3) We also do not allow to set further CMAES params in the threshold tuning.

berndbischl commented 9 years ago

done