# NOT RUN {
# generate the toy example
beta <- matrix(c(1,2,1,-1,1,2), ncol=2)
res <- gen_multi_data(beta, N = 10000, type = 'cat', test_ratio = 0.3)
train_id <- res$train_id
train <- res$train
test <- res$test
res <- init_multi_data(train_id, train, init_N = 300, type = 'cat')
splitted <- res$splitted
train <- res$train
newY <- res$newY
labeled_ids <- res$labeled_ids
unlabeled_ids <- res$unlabeled_ids
data <- res$data
# use seq_cat_model to multi-classification problem under the categorical case.
# You can remove '#' to run the command.
# start_time <- Sys.time()
# logitA_cat <- seq_cat_model(labeled_ids, unlabeled_ids, splitted, newY,
# train, data, d = 0.5, adaptive = "A_optimal")
# logitA_cat$time <- as.numeric(Sys.time() - start_time, units = "mins")
# print(logitA_cat)
# }
Run the code above in your browser using DataLab