dmbc_predict: Predict probability from DMBC model

Description Usage Arguments Examples

View source: R/dmbc_predict.r

Description

Based on a set of optimized features from training set, this function predicts the posterior probability for two class labels.

Usage

1
2
3
4
5
6
7
8
9
dmbc_predict(
  data = data,
  testSet = testSet,
  auc_out = auc_out,
  col_start = 3,
  type_col = 2,
  Prior1 = 0.5,
  Prior2 = 1 - Prior1
)

Arguments

data

Validation dataset with rows are samples, columns are features. The first column should be the sample ID, second column group variable (Disease type, the label you want to classify on).

testSet

Lable unknown testSet without sample IDs.

auc_out

Output object of Cal_AUC() from a validation set.

col_start

An index indicating at which column is the beginning of bacteria (features) data in the validation set. The default is the 3rd column.

type_col

An index indicating at which column is group/type variable in the validation set. The default is the 2nd column.

Prior1

Prevalence of label1 according to literature or experience. Default is 0.5.

Prior2

Prevalence of label2 according to literature or experience. Default is 0.5.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#load the DMBC library
library(DMBC)

#load training dataset
data(training)

#load test dataset
data(test)

## calculate AUC based on training set using 10-fold cv ##
auc_out <- Cal_AUC(tfcv(training))

## calculate AUC based on training set using leave-one-out cv ##
auc_out <- Cal_AUC(loocv(training))

#predict unknown test set using training set and auc results.
dmbc_predict(data=training,testSet=test,auc_out=auc_out)

qunfengdong/DMBC documentation built on April 22, 2020, 7:27 p.m.