Learn R Programming

kebabs (version 1.6.2)

ROCDataAccessors: ROCData Accessors

Description

ROCData Accessors

Usage

## S3 method for class 'ROCData':
auc(object)

Arguments

object
an object of class ROCData

Value

  • auc: returns a numeric value tpr: returns a numeric vector fpr: returns a numeric vector

References

http://www.bioinf.jku.at/software/kebabs J. Palme, S. Hochreiter, and U. Bodenhofer (2015) KeBABS: an R package for kernel-based analysis of biological sequences. Bioinformatics, 31(15):2574-2576, 2015. DOI: http://dx.doi.org/10.1093/bioinformatics/btv176{10.1093/bioinformatics/btv176}.

Examples

Run this code
## create kernel object for normalized spectrum kernel
specK5 <- spectrumKernel(k=5)
## load data
data(TFBS)

## select 70% of the samples for training and the rest for test
train <- sample(1:length(enhancerFB), length(enhancerFB) * 0.7)
test <- c(1:length(enhancerFB))[-train]

## perform training - feature weights are computed by default
model <- kbsvm(enhancerFB[train], yFB[train], specK5, pkg="LiblineaR",
               svm="C-svc", cost=15)
preddec <- predict(model, enhancerFB[test], predictionType="decision")
rocdata <- computeROCandAUC(preddec, yFB[test], allLabels=unique(yFB))

## accessor for auc
auc(rocdata)

Run the code above in your browser using DataLab