View source: R/data_generation.R
data_generation | R Documentation |
The function data_generation generates an example dataset for applying the cossonet function.
data_generation(
n,
p,
rho,
SNR,
response = c("continuous", "binary", "count", "survival")
)
n |
observation size. |
p |
dimension. |
rho |
a positive integer indicating the correlation strength for the first four informative variables. |
SNR |
signal-to-noise ratio. |
response |
the type of the response variable. |
a list of explanatory variables, response variables, and true functions.
# Generate example data
set.seed(20250101)
tr = data_generation(n = 200, p = 20, SNR = 9, response = "continuous")
tr_x = tr$x
tr_y = tr$y
te = data_generation(n = 1000, p = 20, SNR = 9, response = "continuous")
te_x = te$x
te_y = te$y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.