Code
library("masbayes")
d <- load_data("small")
W <- construct_snp_matrix(d$snp)$W
y_bin <- as.numeric(d$pheno$y_bin_qtl_snp)
W_train <- W[d$train_idx, ]
W_test <- W[d$test_idx, ]
fit <- run_bayesa(
w = W_train,
y = y_bin[d$train_idx],
nu = 4.5,
sigma2_g = 1.0,
sigma2_e_init = 1.0,
mcmc_params = list(n_iter = 1000L, n_burn = 500L,
n_thin = 5L, seed = 1L),
response_type = "binary",
save_rds = FALSE
)
pred <- predict(fit, W_test, y_bin[d$test_idx])
pred$metrics$AUC