xdim <- 5
basisN <- 1000
type <- 'cosine'
#non-linear additive truth. Half of the features are truly associated with the outcome
TrainData <- GenSamples(s.size = 300, xdim = xdim,
frho = 'additive', frho.para = xdim/2)
#noise-free testing samples
TestData <- GenSamples(s.size = 1e3, xdim = xdim, noise.para = 0,
frho = 'additive', frho.para = xdim/2)
sieve.model <- sieve_preprocess(X = TrainData[,2:(xdim+1)],
basisN = basisN, type = type, interaction_order = 2)
sieve.model <- sieve_solver(sieve.model, TrainData$Y, l1 = TRUE)
sieve_model_prediction <- sieve_predict(testX = TestData[,2:(xdim+1)],
testY = TestData$Y, sieve.model)
Run the code above in your browser using DataLab