Description Usage Arguments Value Examples
View source: R/calculate_AUCs.R
The main function of SSD package: build the model and calculate the AUCs with parallel, you can also get the resulting plot via this function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | calculate_AUCs(
n01_all = c(800, 800),
n01_p = c(15, 15),
n_train_sets = c(c(15, 15), c(30, 30), c(60, 60), c(120, 120), c(150, 150)),
n01_test = c(300, 300),
num_of_seeds = 20,
random_seeds = TRUE,
seeds = NULL,
calculate_std_of_AUC_and_produce_plot = FALSE,
method = "pca2_mvnorm",
ncores = NULL,
model = c("svm", "randomforest"),
func = NULL,
package_imported = NULL,
data_generation = list(dist = "t-distribution", sigma = list(class_0 = diag(5),
class_1 = diag(5)), df = c(10, 10), delta = c(rep(0, 5), rep(2, 5))),
data_input = NULL,
true_data_to_compare = 1
)
|
n01_all |
size of all data labeled as class 0/1. For example, n01_all=c(800,800) represents that the size of all data labeled as class 0 is 800 and the size of all data labeled as class 1 is also 800. |
n01_p |
size of pilot data labeled as class 0/1. For example, n01_p=c(15,15) represents that the size of pilot data labeled as class 0 is 15 and the size of pilot data labeled as class 1 is also 15. |
n_train_sets |
size sets of training data labeled as class 0/1. For example, n_train_sets=c(c(30,30),c(90,90),c(150,150)) represents that we try 3 different sets of training data and the training size of the first set is c(30,30). |
n01_test |
number of test data labeled as class 0/1. size of all data labeled as class 0/1. For example, n01_test=c(300,300) represents that the size of test data labeled as class 0 is 300 and the size of test data labeled as class 1 is also 300. |
num_of_seeds |
number of seeds you want to use to run simulations.(If you want to make the plots, "num_of_seeds" must be not smaller than 2) |
random_seeds |
If TRUE, it will produce "num_of_seeds" seeds randomly. If FASLE, it will use seeds "1:num_of_seeds", which is used to make it reproducible. |
seeds |
You can choose the seeds set as you wish. It's default value is NULL. If it's not NULL, the function will use your seeds and ignore parameters "num_of_seeds" and "random_seeds". |
calculate_std_of_AUC_and_produce_plot |
You can calculate the standard deviation of AUC and produce the plot directly if you set this parameter to TRUE. It will create a new folder named "result" in your current directory and save the plots into it. |
method |
Choose the method you want to use: "pca2_mvnorm" , "gaussian_copula" or "smote"( |
ncores |
number of cores used for parallel computing. Default = detectCores() - 1. |
model |
base classification model.
|
func |
If you set "model" to "self", you have to pass your self-defined model function. This function should be able to take "x_train" and "y_train" as the first two inputs to train the model and then take "x_test" as the third input and return the predicted scores of x_test data. For example, |
package_imported |
If you set "model" to "self",state the names of the packages you used in your "func", which have to be specified when using parallel computing. |
data_generation |
a parameter list that you can tell the function about the distribution and parameters you want to use to generate the data.
|
data_input |
Its default value is NULL and the function will use the "data_generation" parameter to generate the data. If "data_input" is not NULL, the function will ignore the "data_generation" parameter and "n01_all" parameter, and use the "data_input" as the data.
Your "data_input" should be a list with "x_data" matrix and "y_data" matrix. For example, |
true_data_to_compare |
0/1 variable, whether to have the true data to compare with generated data (which could make the output matrix double): if input_data==NULL(run the simulations), we will generate the true data automatically and calculate the AUCs; if you give us the input_data, please make sure that you give us sufficient input data. |
Return the AUCs you want to calculate
1 2 3 4 5 6 7 | res = calculate_AUCs(n01_all = c(800, 800), n01_p = c(15, 15),
n_train_sets = c(c(15, 15), c(30, 30), c(60, 60), c(120, 120),
c(150, 150)), n01_test = c(300, 300), num_of_seeds = 20,
random_seeds = FALSE, calculate_std_of_AUC_and_produce_plot = TRUE,
data_generation = list(dist = "t-distribution", sigma = list(class_0 = diag(5),
class_1 = diag(5)), df = c(10, 10), delta = c(rep(0, 5),
rep(2, 5))), true_data_to_compare = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.