calculate_std_of_AUC_and_draw_plot: Calculate std and draw the plots

Description Usage Arguments Value Examples

View source: R/calculate_std_of_AUC_and_draw_plot.R

Description

Calculate std and draw the plots

Usage

1
2
3
4
5
6
calculate_std_of_AUC_and_draw_plot(
  res,
  n_train_sets,
  model,
  true_data_to_compare = 1
)

Arguments

res

the result produced by cal_parallel

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).

model

base classification model set which is corresponding to the result in the "res".

  • logistic: Logistic regression. glm function with family = 'binomial'

  • penlog: Penalized logistic regression with LASSO penalty. glmnet in glmnet package

  • svm: Support Vector Machines. svm in e1071 package

  • randomforest: Random Forest. randomForest in randomForest package

  • lda: Linear Discriminant Analysis. lda in MASS package

  • slda: Sparse Linear Discriminant Analysis with LASSO penalty.

  • nb: Naive Bayes. naiveBayes in e1071 package

  • nnb: Nonparametric Naive Bayes. naive_bayes in naivebayes package

  • ada: Ada-Boost. ada in ada package

  • xgboost: XGBboost. xgboost in xgboost package

  • tree: Classificatin Tree. tree in tree package

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.

Value

It will save all the result to the new "result" folder created in your current directory.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
AUC_1 = calculate_AUC_base(n01_p = c(15, 15), n01_test = c(300, 300), seed = 1,
    model = c("svm", "randomforest"), n_train_sets = c(c(15, 15), c(30, 30),
        c(60, 60), c(120, 120), c(150, 150)))
AUC_2 = calculate_AUC_base(n01_p = c(15, 15), n01_test = c(300, 300), seed = 1,
    model = c("svm", "randomforest"), n_train_sets = c(c(15, 15), c(30, 30),
        c(60, 60), c(120, 120), c(150, 150)))
res = {
}
res[[1]] = AUC_1
res[[2]] = AUC_2
calculate_std_of_AUC_and_draw_plot(res, n_train_sets = c(c(15, 15), c(30, 30),
    c(60, 60), c(120, 120), c(150, 150)), model = c("svm", "randomforest"),
    true_data_to_compare = 1)

ShudongSun/Sample-Size-Determination documentation built on Feb. 10, 2022, 1:33 a.m.