### a simple k-nearest neighbour example
### datasets
## Not run: plot(x)
# data(golub)
# golubY <- golub[,1]
# golubX <- as.matrix(golub[,-1])
# ### learningsets
# set.seed(111)
# lset <- GenerateLearningsets(y=golubY, method = "CV", fold=5, strat =TRUE)
# ### 1. GeneSelection
# selttest <- GeneSelection(golubX, golubY, learningsets = lset, method = "t.test")
# ### 2. tuning
# tunek <- tune(golubX, golubY, learningsets = lset, genesel = selttest, nbgene = 20, classifier = knnCMA)
# ### 3. classification
# knn1 <- classification(golubX, golubY, learningsets = lset, genesel = selttest,
# tuneres = tunek, nbgene = 20, classifier = knnCMA)
# ### steps 1.-3. combined into one step:
# knn2 <- classification(golubX, golubY, learningsets = lset,
# genesellist = list(method = "t.test"), classifier = knnCMA,
# tuninglist = list(grids = list(k = c(1:8))), nbgene = 20)
# ### show and analyze results:
# knnjoin <- join(knn2)
# show(knn2)
# eval <- evaluation(knn2, measure = "misclassification")
# show(eval)
# summary(eval)
# boxplot(eval)
# ## End(Not run)
Run the code above in your browser using DataLab