Skip to content

Instantly share code, notes, and snippets.

@Laurae2
Created December 24, 2018 21:05
Show Gist options
  • Save Laurae2/d89a89262d4a9bacee816e797ed08b07 to your computer and use it in GitHub Desktop.
Save Laurae2/d89a89262d4a9bacee816e797ed08b07 to your computer and use it in GitHub Desktop.
Matrix size
set.seed(1)
N <- 500000
p <- 100
pp <- 25
X <- matrix(runif(N * p), ncol = p)
betas <- 2 * runif(pp) - 1
sel <- sort(sample(p, pp))
m <- X[, sel] %*% betas - 1 + rnorm(N)
y <- rbinom(N, 1, plogis(m))
tr <- sample.int(N, N * 0.90)
format(object.size(X[tr,]), units = "Mb")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment