markvdwiel / GRridge

R package for better prediction by use of co-data: Adaptive group-regularized ridge regression
4 stars 2 forks source link

Error in if (max(indexset) > nr | min(indexset) < 1) { : missing value where TRUE/FALSE needed #1

Closed mdoscho closed 3 years ago

mdoscho commented 6 years ago

Hi! I am trying to reproduce the first example of the vignette. After

grFarkas <- grridge(datcenFarkas, respFarkas, partitionsFarkas, optl=5.680087, monotone= monotoneFarkas)

the following error shows up

[1] "Binary response, executing logistic ridge regression" [1] "Predicting probability on factor level Precursor" [1] "Covariates are standardized" Error in if (max(indexset) > nr | min(indexset) < 1) { : missing value where TRUE/FALSE needed

Apparently,

library(doParallel)
indexset = foreach(ncl = 1:nclass, .combine = "c") %do% { unlist(partitions[[ncl]],use.names = FALSE ) }
summary(indexset)

contains a large amount of NAs

Min. 1st Qu. Median Mean 3rd Qu. Max. NA's 1 10001 20001 20001 30000 40000 10000

Further, both min(indexset), max(indexset) return NAs.

Thanks Michael

sessionInfo()

R version 3.5.0 (2018-04-23) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

mdoscho commented 6 years ago

Solved the problem changing grsize from 5000 to 4000.