method: Accessors for the 'method' slot of an 'MLSeq' object

Description Usage Arguments Details Author(s) See Also Examples

Description

This slot stores the name of selected model which is used in classify function. The trained model is stored in slot trainedModel. See trained for details.

Usage

1
2
3
4
method(object)

## S4 method for signature 'MLSeq'
method(object)

Arguments

object

an MLSeq object.

Details

method slot stores the name of the classification method as "svm", support vector machines using radial-based kernel function; "bagsvm", support vector machines with bagging ensemble; "randomForest", random forest algorithm and "cart", classification and regression trees algorithm.

Author(s)

Gokmen Zararsiz

See Also

trained

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
library(DESeq2)
data(cervical)

# a subset of cervical data with first 150 features.
data <- cervical[c(1:150),]

# defining sample classes.
class <- data.frame(condition=factor(rep(c("N","T"), c(29,29))))

n <- ncol(data)  # number of samples
p <- nrow(data)  # number of features

# number of samples for test set (20% test, 80% train).
nTest <- ceiling(n*0.2)
ind <- sample(n, nTest, FALSE)

# train set
data.train <- data[,-ind]
data.train <- as.matrix(data.train + 1)
classtr <- data.frame(condition=class[-ind, ])

# train set in S4 class
data.trainS4 <- DESeqDataSetFromMatrix(countData = data.train,
                  colData = classtr, formula(~ condition))
data.trainS4 <- DESeq(data.trainS4, fitType = "local")

# Classification and Regression Trees (CART)
cart <- classify(data = data.trainS4, method = "cart",
          transformation = "vst", ref = "T", normalize = "deseq",
          control = trainControl(method = "repeatedcv", number = 5,
                                 repeats = 3, classProbs = TRUE))

method(cart)

gokmenzararsiz/MLSeq documentation built on May 17, 2019, 7:41 a.m.