Closed MalteKurz closed 2 years ago
@PhilippBach Would be great, if you could quickly comment on this. I can then do the implementation, which is quick and easy. Furthermore, I am anyways working on some minor fixes and updates right now.
@PhilippBach Would be great, if you could quickly comment on this. I can then do the implementation, which is quick and easy. Furthermore, I am anyways working on some minor fixes and updates right now.
Please find a fix proposal in #160, see e09408cefc9080fdeeb72f5293969b1719a1878e
Hi @MalteKurz ,
sorry for my late reply!
I would expect that the ML methods are tuned successfully. For all nuisance parts where a measure was actively set, I expect it to be used and for all other nuisance parts I would expect that it falls back to the default measure. I expect this behavior, because otherwise it wouldn't make sense to check for subset here
I agree! That's what I'd expect too and I'd guess that it's probably what most users would expect too! Thanks for proposing the fix! I think it looks good!
Describe the bug
The
tune
method allows to specify a nuisance specificmeasure
. If the list provided contains a name that is not a nuisance part, a meaningful error message is produced, i.e.,tune_settings[['measure']] = list(ml_m = "regr.mae", ml_wrong_name = "regr.rmse")
results in something like:However, if the list of measures is a real subset (e.g.
tune_settings[['measure']] = list(ml_m = "regr.mae")
) of the nuisance parts it fails with a non-meaningful error message:Minimum reproducible code snippet
Expected Result
I would expect that the ML methods are tuned successfully. For all nuisance parts where a
measure
was actively set, I expect it to be used and for all other nuisance parts I would expect that it falls back to the defaultmeasure
. I expect this behavior, because otherwise it wouldn't make sense to check for subset here https://github.com/DoubleML/doubleml-for-r/blob/acb9d46ee7eece72efff61e6cdc089c69696572b/R/double_ml.R#L1316-L1323.Alternative expected behavior: As an alternative we could enforce that either for every nuisance part there is
measure
set or for none (resulting in defaultmeasure
s being used for every nuisance part). If we go for this alternative solution, we should check for exactly matching list keys instead of checking for a subset. This would then produce a meaningful error message. However, I prefer the above described solution where we fall back to defaultmeasure
s for every nuisance part where nomeasure
was actively set (the implementation of this selective fallback solution would be easy).Actual Result
Versions