data("SinghTest")
gene1
gene2
gene3
gene4
gene5
gene6
gene7
gene8
gene9
gene10
gene11
gene12
gene13
gene14
gene15
gene16
gene17
gene18
gene19
gene20
gene21
gene22
gene23
gene24
gene25
gene26
gene27
gene28
gene29
gene30
gene31
gene32
gene33
gene34
gene35
gene36
gene37
gene38
gene39
gene40
gene41
gene42
gene43
gene44
gene45
gene46
gene47
gene48
gene49
gene50
gene51
gene52
gene53
gene54
gene55
gene56
gene57
gene58
gene59
gene60
gene61
gene62
gene63
gene64
gene65
gene66
gene67
gene68
gene69
gene70
gene71
gene72
gene73
gene74
gene75
gene76
gene77
gene78
gene79
gene80
gene81
gene82
gene83
gene84
gene85
gene86
gene87
gene88
gene89
gene90
gene91
gene92
gene93
gene94
gene95
gene96
gene97
gene98
gene99
gene100
health
normal
tumor
featureSelect
,
churnTrain
require("MASS")
data(SinghTest)
BestGenes <- 10
XTr <- SinghTrain[,1:BestGenes]
yTr <- SinghTrain$health
ans <- lda(x=XTr, grouping=yTr)
XTe <- SinghTest[,1:BestGenes]
yH <- predict(ans, newdata=XTe)$class
yTe <- SinghTest$health
table(yTe, yH)
Run the code above in your browser using DataLab