classifiACC: Compute the classification accuracy

View source: R/resultReport.R

classifiACCR Documentation

Compute the classification accuracy

Description

Compute the classification accuracy for the binary classification problem.

Usage

classifiACC(dataY, predY)

Arguments

dataY

The observed outcome.

predY

The predicted outcome.

Value

The classification accuracy in terms of percentage.

Author(s)

Junfang Chen

Examples

 
## Load data  
methylfile <- system.file('extdata', 'methylData.rds', package='BioMM')  
methylData <- readRDS(methylfile) 
dataY <- methylData[,1]
methylSub <- data.frame(label=dataY, methylData[,c(2:1001)])  
library(ranger)  
library(BiocParallel)
param1 <- MulticoreParam(workers = 1) 
param2 <- MulticoreParam(workers = 10) 
predY <- predByCV(methylSub, repeats=1, nfolds=10,   
                  FSmethod=NULL, cutP=0.1, 
                  fdr=NULL, FScore=param1, 
                  classifier='randForest',
                  predMode='classification', 
                  paramlist=list(ntree=300, nthreads=1),
                  innerCore=param2)  
accuracy <- classifiACC(dataY=dataY, predY=predY)
print(accuracy)  

transbioZI/BioMMex documentation built on April 2, 2022, 8:48 a.m.