stan-dev / projpred

Projection predictive variable selection
https://mc-stan.org/projpred/
Other
110 stars 26 forks source link

A more verbose progress printing option #363

Closed jtimonen closed 1 year ago

jtimonen commented 1 year ago

The first commit just changes the used print() in in forward search to message(). The other commits then enable setting an option

options(projpred.extra_verbose = TRUE)

which enables output like

  - projecting to 1
  - projecting to 1 + s(x1)
  - projecting to 1 + s(x2)
  - projecting to 1 + s(x3)
  - projecting to 1 + s(x4)
  - projecting to 1 + x1
  - projecting to 1 + x2
  - projecting to 1 + x3
  - projecting to 1 + x4
10% of terms selected: 1 + s(x1)
  - projecting to 1 + s(x1) + s(x2)
  - projecting to 1 + s(x1) + s(x3)
  - projecting to 1 + s(x1) + s(x4)
  - projecting to 1 + s(x1) + x2
  - projecting to 1 + s(x1) + x3
  - projecting to 1 + s(x1) + x4
20% of terms selected: 1 + s(x1) + s(x2)
  - projecting to 1 + s(x1) + s(x2) + s(x3)
  - projecting to 1 + s(x1) + s(x2) + s(x4)
  - projecting to 1 + s(x1) + s(x2) + x3
  - projecting to 1 + s(x1) + s(x2) + x4
30% of terms selected: 1 + s(x1) + s(x2) + s(x4)
  - projecting to 1 + s(x1) + s(x2) + s(x4) + s(x3)
  - projecting to 1 + s(x1) + s(x2) + s(x4) + x3
50% of terms selected: 1 + s(x1) + s(x2) + s(x4) + s(x3)
  - projecting to {}
  - projecting to s(x1)
  - projecting to s(x1) + s(x2)
  - projecting to s(x1) + s(x2) + s(x4)
  - projecting to s(x1) + s(x2) + s(x4) + s(x3)

for varsel(). When the option is FALSE, only the "x% of terms selected" messages are printed if verbose = TRUE. None of this is printed if verbose = FALSE.

fweber144 commented 1 year ago

Thanks! Unfortunately, it will take me some time until I can look at this further. In principle, however, this seems like a reasonable suggestion.

jtimonen commented 1 year ago

No problem!

fweber144 commented 1 year ago

I have pushed some commits which provide some minor enhancements. I will also create another PR afterwards which is going to enhance verbose output further. Thanks again for creating this PR. Merging now.