kapelner / bartMachine

An R-Java Bayesian Additive Regression Trees implementation
MIT License
62 stars 27 forks source link

bartMachineCV is too verbose even with verbose = FALSE: it drops the verbose argument and includes cat's #55

Open rdiaz02 opened 7 months ago

rdiaz02 commented 7 months ago

bartMachineCV is very verbose, even with verbose = FALSE. I know some messages come from Java directly, but there are others that come from R and that, arguably, should not be produced with verbose = FALSE. Two main issues:

  1. At the end of build_bart_machine_cv , here: https://github.com/kapelner/bartMachine/blob/67607dedeec186ea90eaa960224253d56f93a314/bartMachine/R/bart_package_builders.R#L682 , the call to bart_machine_cv does not pass the verbose argument (passing the ... does not do here), and thus bart_machine_cv is run with its default verbose = TRUE.
    (How to reproduce: launch bartMachineCV and set a break point right before that call.

These are some screenshots of such a debugging session. Note the value of verbose is FALSE:

before

We run and this happens (note the verbose output) after_1

Now, if we call bart_machine_cv explicitly passing verbose = verbose it honors the argument:

before2

after_2

  1. A second problem is that build_bart_machine_cv has many cats that are not surrounded by the if (verbose) construction that is present in, say, build_bart_machine itself . (I actually wonder if using cat, instead of message is best practice; but this is a different issue).