if (FALSE) {
### load plsgenomics library
library(plsgenomics)
### generating data
n <- 100
p <- 100
sample1 <- sample.bin(n=n, p=p, kstar=10, lstar=2,
beta.min=0.25, beta.max=0.75, mean.H=0.2,
sigma.H=10, sigma.F=5)
X <- sample1$X
Y <- sample1$Y
### pertinent covariates id
sample1$sel
### hyper-parameters values to test
lambda.l1.range <- seq(0.05,0.95,by=0.1) # between 0 and 1
ncomp.range <- 1:10
# log-linear range between 0.01 a,d 1000 for lambda.ridge.range
logspace <- function( d1, d2, n) exp(log(10)*seq(d1, d2, length.out=n))
lambda.ridge.range <- signif(logspace(d1 <- -2, d2 <- 3, n=21), digits=3)
### tuning the hyper-parameters
stab1 <- logit.spls.stab(X=X, Y=Y, lambda.ridge.range=lambda.ridge.range,
lambda.l1.range=lambda.l1.range,
ncomp.range=ncomp.range,
adapt=TRUE, maxIter=100, svd.decompose=TRUE,
ncores=1, nresamp=100)
str(stab1)
### heatmap of estimated probabilities
stability.selection.heatmap(stab1)
### selected covariates
stability.selection(stab1, piThreshold=0.6, rhoError=10)
}
Run the code above in your browser using DataLab