SzymonNowakowski / DMRnet

This is a development version of DMRnet — Delete or Merge Regressors Algorithms for Linear and Logistic Model Selection and High-Dimensional Data.
1 stars 0 forks source link

Warnings in `hard_case_DMRnet_insurance.R` #33

Closed SzymonNowakowski closed 1 year ago

SzymonNowakowski commented 2 years ago

There was a warning

Warning message:
In min(sp[[kt]][sp[[kt]] != 1]) :
  no non-missing arguments to min; returning Inf

in tests conducted for 0.3.1 version (see the relevant tag)

SzymonNowakowski commented 1 year ago

Not observed in hard_case_DMRnet_insurance.R results for 0.3.2. Maybe a different machine was involved. See the relevant link for this tag

Action: Check if it is the computer settings related to warning printout that are involved in printing/not printing this warning. Action: try repeating the commit 3091ad44b9 hard_case... tests

SzymonNowakowski commented 1 year ago

I rerun the tests for commit 3091ad4 on three machines: dw, dr and dg. The tests on dw and dr were positive (=reproduced the issue) , while the test on dg was not (=not reproduced). It is unclear for me why it is not present on dg.

Thus I further worked on dw. I was able to reproduce the issue on 0.3.2.9001 version:

Loading required package: usethis
ℹ Loading DMRnet
Loaded DMRnet version 0.3.2.9001
Warning messages:
1: In FUN(X[[i]], ...) :
  input string '紐約, NY, United States' cannot be translated to UTF-8, is it valid in 'CP1250'?
2: In FUN(X[[i]], ...) :
  input string 'Бруклин , NY, United States' cannot be translated to UTF-8, is it valid in 'CP1250'?
3: In FUN(X[[i]], ...) :
  input string '布鲁克林, NY, United States' cannot be translated to UTF-8, is it valid in 'CP1250'?
glamer single 2-level factor column:
dmrnet single 2-level factor column:
dmr single 2-level factor column:
glamer:
dmrnet:
cv.dmrnet:
dmr:
cv.dmr:
binomial glamer single 2-level factor column:
binomial dmrnet single 2-level factor column:
binomial dmr single 2-level factor column:
binomial glamer:
binomial dmrnet:
binomial cv.dmrnet:
Warning message:
In min(sp[[kt]][sp[[kt]] != 1]) :
  no non-missing arguments to min; returning Inf
binomial dmr:
binomial cv.dmr:
completed

The three warnings just after the package got loaded are related to the airbnb dataset present in testing_branch, it is not present in master branch, so they are not of our concern now.

What is of our concern is the successful reproduction of

Warning message:
In min(sp[[kt]][sp[[kt]] != 1]) :
  no non-missing arguments to min; returning Inf
SzymonNowakowski commented 1 year ago

The min(sp string can be found in 6 files:

$ grep "min(sp" R/*.R
R/clusters_4glm_help.R:        dod <- min(sp[[kt]][sp[[kt]] != 1])
R/clusters_4glm_help.R:          sp[[kt]][sp[[kt]] != 1] <- sp[[kt]][sp[[kt]] != 1] + dod - min(sp[[kt]][sp[[kt]] != 1])
R/clusters_4lm_help.R:        dod <- min(sp[[kt]][sp[[kt]] != 1])
R/clusters_4lm_help.R:          sp[[kt]][sp[[kt]] != 1] <- sp[[kt]][sp[[kt]] != 1] + dod - min(sp[[kt]][sp[[kt]] != 1])
R/DMR4glm_help.R:           dod <- min(sp[[kt]][sp[[kt]] != 1])
R/DMR4glm_help.R:                                       sp[[kt]][sp[[kt]] != 1] <- sp[[kt]][sp[[kt]] != 1] + dod - min(sp[[kt]][sp[[kt]] != 1])
R/DMR4glm.R:           dod <- min(sp[[kt]][sp[[kt]] != 1])
R/DMR4glm.R:                                       sp[[kt]][sp[[kt]] != 1] <- sp[[kt]][sp[[kt]] != 1] + dod - min(sp[[kt]][sp[[kt]] != 1])
R/DMR4lm_help.R:           dod <- min(sp[[kt]][sp[[kt]] != 1])
R/DMR4lm_help.R:                                       sp[[kt]][sp[[kt]] != 1] <- sp[[kt]][sp[[kt]] != 1] + dod - min(sp[[kt]][sp[[kt]] != 1])
R/DMR4lm.R:           dod <- min(sp[[kt]][sp[[kt]] != 1])
R/DMR4lm.R:                                       sp[[kt]][sp[[kt]] != 1] <- sp[[kt]][sp[[kt]] != 1] + dod - min(sp[[kt]][sp[[kt]] != 1])
SzymonNowakowski commented 1 year ago

Candidate fix issued in 0.3.2.9004

SzymonNowakowski commented 1 year ago

fixed in 0.3.3 - see the relevant tag